From 4f77725a74d229a8078e9057131b47e772d13d57 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 1 Jun 2011 15:12:14 +0200 Subject: [PATCH] update ArrayInput --- source/Ox.UI/js/Form/Ox.ArrayInput.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/Ox.UI/js/Form/Ox.ArrayInput.js b/source/Ox.UI/js/Form/Ox.ArrayInput.js index 49545183..b2514659 100644 --- a/source/Ox.UI/js/Form/Ox.ArrayInput.js +++ b/source/Ox.UI/js/Form/Ox.ArrayInput.js @@ -56,8 +56,7 @@ Ox.ArrayInput = function(options, self) { .appendTo(self.$element[i])); focus && self.$input[i].focusInput(); self.$removeButton.splice(i, 0, Ox.Button({ - disabled: self.$input.length == 1, - title: 'remove', + title: self.$input.length == 1 ? 'close' : 'remove', type: 'image' }) .css({float: 'left', marginLeft: '8px'}) @@ -68,7 +67,11 @@ Ox.ArrayInput = function(options, self) { self.$input[index].options({value: ''}); that.triggerEvent('change', {value: that.value()}); } - removeInput(index); + if (self.$input.length == 1) { + self.$input[0].focusInput(); + } else { + removeInput(index); + } } }) .appendTo(self.$element[i]));