From 3130de08c52190c6d98fe3774dda17eafd8cb876 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Thu, 10 Nov 2011 10:44:35 +0000 Subject: [PATCH] fix a bug where clicking on a separator in an input group would call focusInput of an element without such a method --- source/Ox.UI/js/Form/Ox.Filter.js | 5 +++-- source/Ox.UI/js/Form/Ox.InputGroup.js | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/source/Ox.UI/js/Form/Ox.Filter.js b/source/Ox.UI/js/Form/Ox.Filter.js index 90ed2fe5..12e7c60a 100644 --- a/source/Ox.UI/js/Form/Ox.Filter.js +++ b/source/Ox.UI/js/Form/Ox.Filter.js @@ -252,9 +252,10 @@ Ox.Filter = function(options, self) { ] }); + // limit and view temporarily disabled self.$items = self.options.list - ? [self.$operator, self.$save, self.$limit, self.$view] - : [self.$operator, self.$limit, self.$view]; + ? [self.$operator, self.$save/*, self.$limit, self.$view*/] + : [self.$operator/*, self.$limit, self.$view*/]; self.numberOfAdditionalFormItems = self.$items.length; diff --git a/source/Ox.UI/js/Form/Ox.InputGroup.js b/source/Ox.UI/js/Form/Ox.InputGroup.js index b78cff33..9f79e813 100644 --- a/source/Ox.UI/js/Form/Ox.InputGroup.js +++ b/source/Ox.UI/js/Form/Ox.InputGroup.js @@ -83,7 +83,12 @@ Ox.InputGroup = function(options, self) { function click(event) { if ($(event.target).hasClass('OxSeparator')) { - self.options.inputs[0].focusInput(); + Ox.forEach(self.options.inputs, function($input) { + if ($input.focusInput) { + $input.focusInput(); + return false; + } + }); } }