forked from 0x2620/oxjs
self.setOption ~> that.update
This commit is contained in:
parent
9ee0742b53
commit
005d50c389
56 changed files with 919 additions and 933 deletions
|
|
@ -46,6 +46,30 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
width: 256
|
||||
})
|
||||
.options(options || {})
|
||||
.update(function(key, value) {
|
||||
if (key == 'highlight') {
|
||||
self.$folder.forEach(function($folder) {
|
||||
$folder.options({highlight: value});
|
||||
});
|
||||
} else if (['in', 'out', 'position'].indexOf(key) > -1) {
|
||||
self.$folder.forEach(function($folder) {
|
||||
$folder.options(key, value);
|
||||
});
|
||||
} else if (key == 'selected') {
|
||||
self.options.editable && updateEditMenu();
|
||||
if (value) {
|
||||
getFolder(value).options({selected: value});
|
||||
} else {
|
||||
self.$folder.forEach(function($folder) {
|
||||
$folder.options({selected: ''});
|
||||
});
|
||||
}
|
||||
} else if (key == 'width') {
|
||||
self.$folder.forEach(function($folder) {
|
||||
$folder.options({width: self.options.width - Ox.UI.SCROLLBAR_SIZE});
|
||||
});
|
||||
}
|
||||
})
|
||||
.addClass('OxAnnotationPanel');
|
||||
|
||||
self.editing = false;
|
||||
|
|
@ -458,31 +482,6 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
self.$editMenuButton[action]('delete');
|
||||
}
|
||||
|
||||
self.setOption = function(key, value) {
|
||||
if (key == 'highlight') {
|
||||
self.$folder.forEach(function($folder) {
|
||||
$folder.options({highlight: value});
|
||||
});
|
||||
} else if (['in', 'out', 'position'].indexOf(key) > -1) {
|
||||
self.$folder.forEach(function($folder) {
|
||||
$folder.options(key, value);
|
||||
});
|
||||
} else if (key == 'selected') {
|
||||
self.options.editable && updateEditMenu();
|
||||
if (value) {
|
||||
getFolder(value).options({selected: value});
|
||||
} else {
|
||||
self.$folder.forEach(function($folder) {
|
||||
$folder.options({selected: ''});
|
||||
});
|
||||
}
|
||||
} else if (key == 'width') {
|
||||
self.$folder.forEach(function($folder) {
|
||||
$folder.options({width: self.options.width - Ox.UI.SCROLLBAR_SIZE});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/*@
|
||||
addItem <f> add item
|
||||
(layer, item) -> <o> add item to layer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue