editable/arrayeditable: support placeholder update

This commit is contained in:
rolux 2013-03-08 16:42:03 +05:30
parent c5f75d98c9
commit 8e91501104
2 changed files with 9 additions and 1 deletions

View file

@ -54,6 +54,11 @@ Ox.ArrayEditable = function(options, self) {
}
renderItems(true);
},
placeholder: function() {
if (self.options.items.length == 0) {
self.$items[0].options({placeholder: self.options.placeholder});
}
},
selected: function() {
selectItem(self.options.selected);
},
@ -130,7 +135,7 @@ Ox.ArrayEditable = function(options, self) {
}
that.empty();
if (self.options.items.length == 0) {
Ox.Editable({
self.$items[0] = Ox.Editable({
editable: false,
type: self.options.type,
value: self.options.placeholder

View file

@ -60,6 +60,9 @@ Ox.Editable = function(options, self) {
highlight: function() {
self.$value.html(formatValue());
},
placeholder: function() {
self.$value.html(formatValue());
},
value: function() {
self.$value.html(formatValue());
}