diff --git a/source/Ox.UI/js/Form/Filter.js b/source/Ox.UI/js/Form/Filter.js index 021d3227..7a67d82f 100644 --- a/source/Ox.UI/js/Form/Filter.js +++ b/source/Ox.UI/js/Form/Filter.js @@ -286,7 +286,6 @@ Ox.Filter = function(options, self) { }).appendTo(that); renderConditions(); - //that.$element = self.$form.$element; function addCondition(pos, subpos, isGroup) { subpos = Ox.isUndefined(subpos) ? -1 : subpos; @@ -465,9 +464,9 @@ Ox.Filter = function(options, self) { .bindEvent({ click: function(data) { var key, that = this; - that.$element.focus(); // make input trigger change + that.focus(); // make input trigger change setTimeout(function() { - Ox.print(self.options.value.conditions.length, that.$element.parent().data('subposition') == -1); + Ox.print(self.options.value.conditions.length, that.parent().data('subposition') == -1); if (self.options.value.conditions.length == 1) { key = self.options.findKeys[0]; self.options.value.conditions = [{ @@ -477,12 +476,12 @@ Ox.Filter = function(options, self) { }]; renderConditions(); triggerChangeEvent(); - } else if (that.$element.parent().data('subposition') == -1) { - removeCondition(that.$element.parent().data('position')); + } else if (that.parent().data('subposition') == -1) { + removeCondition(that.parent().data('position')); } else { removeCondition( - that.$element.parent().data('position'), - that.$element.parent().data('subposition') + that.parent().data('position'), + that.parent().data('subposition') ); } }); @@ -498,14 +497,14 @@ Ox.Filter = function(options, self) { .bindEvent({ click: function(data) { var that = this; - that.$element.focus(); // make input trigger change + that.focus(); // make input trigger change setTimeout(function() { - if (that.$element.parent().data('subposition') == -1) { - addCondition(that.$element.parent().data('position') + 1); + if (that.parent().data('subposition') == -1) { + addCondition(that.parent().data('position') + 1); } else { addCondition( - that.$element.parent().data('position'), - that.$element.parent().data('subposition') + 1 + that.parent().data('position'), + that.parent().data('subposition') + 1 ); } }); @@ -522,9 +521,9 @@ Ox.Filter = function(options, self) { .bindEvent({ click: function(data) { var that = this; - that.$element.focus(); // make input trigger change + that.focus(); // make input trigger change setTimeout(function() { - addCondition(that.$element.parent().data('position') + 1, -1, true); + addCondition(that.parent().data('position') + 1, -1, true); }); } }) @@ -558,7 +557,7 @@ Ox.Filter = function(options, self) { }) .bindEvent({ change: function(data) { - var $element = this.$element.parent(); + var $element = this.parent(); changeConditionKey( $element.data('position'), $element.data('subposition'), @@ -582,7 +581,7 @@ Ox.Filter = function(options, self) { }) .bindEvent({ change: function(data) { - var $element = this.$element.parent(); + var $element = this.parent(); changeConditionOperator( $element.data('position'), $element.data('subposition'), @@ -609,7 +608,7 @@ Ox.Filter = function(options, self) { submit: change }); function change(data) { - var $element = this.$element.parent(); + var $element = this.parent(); changeConditionValue( $element.data('position'), $element.data('subposition'), @@ -672,7 +671,7 @@ Ox.Filter = function(options, self) { }) .bindEvent({ change: function(data) { - var $element = this.$element.parent().parent(); + var $element = this.parent().parent(); changeGroupOperator( $element.data('position'), data.value