From 8e9150110435b8f2ba41a8f4f80bd167cb429cc6 Mon Sep 17 00:00:00 2001 From: rolux Date: Fri, 8 Mar 2013 16:42:03 +0530 Subject: [PATCH] editable/arrayeditable: support placeholder update --- source/Ox.UI/js/Form/ArrayEditable.js | 7 ++++++- source/Ox.UI/js/Form/Editable.js | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/source/Ox.UI/js/Form/ArrayEditable.js b/source/Ox.UI/js/Form/ArrayEditable.js index 3c36b4a0..e081e4a4 100644 --- a/source/Ox.UI/js/Form/ArrayEditable.js +++ b/source/Ox.UI/js/Form/ArrayEditable.js @@ -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 diff --git a/source/Ox.UI/js/Form/Editable.js b/source/Ox.UI/js/Form/Editable.js index fe3328e7..1781a174 100644 --- a/source/Ox.UI/js/Form/Editable.js +++ b/source/Ox.UI/js/Form/Editable.js @@ -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()); }