1
0
Fork 0
forked from 0x2620/oxjs

- find in layers

- change upadteAnnotation call to allow id updates
This commit is contained in:
j 2012-01-31 10:57:09 +00:00
commit fd96423266
6 changed files with 81 additions and 38 deletions

View file

@ -11,6 +11,7 @@ Ox.ArrayEditable = function(options, self) {
.defaults({
clickLink: null,
editable: true,
highlight: null,
itemName: 'item',
items: [],
maxHeight: void 0,
@ -269,7 +270,11 @@ Ox.ArrayEditable = function(options, self) {
}
self.setOption = function(key, value) {
if (key == 'items') {
if (key == 'highlight') {
self.$items.forEach(function($item) {
$item.options({highlight: value})
});
} else if (key == 'items') {
if (self.options.selected && getSelectedPosition() == -1) {
selectNone();
}
@ -318,7 +323,7 @@ Ox.ArrayEditable = function(options, self) {
};
that.editItem = function() {
Ox.print('AE EDIT ITEM')
Ox.Log('AE', 'EDIT ITEM', self.options.editable, self.options.selected);
if (self.options.editable && self.options.selected) {
self.editing = true;
self.$items[self.selected].options({editing: true});

View file

@ -25,6 +25,7 @@ Ox.Editable = function(options, self) {
editing: false,
format: null,
height: 0,
highlight: null,
maxHeight: void 0,
placeholder: '',
submitOnBlur: true,
@ -175,6 +176,9 @@ Ox.Editable = function(options, self) {
} else if (self.options.format) {
value = self.options.format(self.options.value)
}
if (self.options.highlight) {
value = Ox.highlight(value, self.options.highlight, 'OxHighlight');
}
return value;
}
@ -234,6 +238,8 @@ Ox.Editable = function(options, self) {
self.$test && self.$test.css(css);
self.$input && self.$input.css(css);
self.$input && self.$input.find(self.options.type).css(css);
} else if (key == 'highlight') {
self.$value.html(formatValue());
} else if (key == 'value') {
self.$value.html(formatValue());
}