that..parent() -> that.parent()

This commit is contained in:
rlx 2014-09-24 20:16:39 +02:00
parent f8336fc2c4
commit 35920ee37d

View file

@ -286,7 +286,6 @@ Ox.Filter = function(options, self) {
}).appendTo(that); }).appendTo(that);
renderConditions(); renderConditions();
//that.$element = self.$form.$element;
function addCondition(pos, subpos, isGroup) { function addCondition(pos, subpos, isGroup) {
subpos = Ox.isUndefined(subpos) ? -1 : subpos; subpos = Ox.isUndefined(subpos) ? -1 : subpos;
@ -465,9 +464,9 @@ Ox.Filter = function(options, self) {
.bindEvent({ .bindEvent({
click: function(data) { click: function(data) {
var key, that = this; var key, that = this;
that.$element.focus(); // make input trigger change that.focus(); // make input trigger change
setTimeout(function() { 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) { if (self.options.value.conditions.length == 1) {
key = self.options.findKeys[0]; key = self.options.findKeys[0];
self.options.value.conditions = [{ self.options.value.conditions = [{
@ -477,12 +476,12 @@ Ox.Filter = function(options, self) {
}]; }];
renderConditions(); renderConditions();
triggerChangeEvent(); triggerChangeEvent();
} else if (that.$element.parent().data('subposition') == -1) { } else if (that.parent().data('subposition') == -1) {
removeCondition(that.$element.parent().data('position')); removeCondition(that.parent().data('position'));
} else { } else {
removeCondition( removeCondition(
that.$element.parent().data('position'), that.parent().data('position'),
that.$element.parent().data('subposition') that.parent().data('subposition')
); );
} }
}); });
@ -498,14 +497,14 @@ Ox.Filter = function(options, self) {
.bindEvent({ .bindEvent({
click: function(data) { click: function(data) {
var that = this; var that = this;
that.$element.focus(); // make input trigger change that.focus(); // make input trigger change
setTimeout(function() { setTimeout(function() {
if (that.$element.parent().data('subposition') == -1) { if (that.parent().data('subposition') == -1) {
addCondition(that.$element.parent().data('position') + 1); addCondition(that.parent().data('position') + 1);
} else { } else {
addCondition( addCondition(
that.$element.parent().data('position'), that.parent().data('position'),
that.$element.parent().data('subposition') + 1 that.parent().data('subposition') + 1
); );
} }
}); });
@ -522,9 +521,9 @@ Ox.Filter = function(options, self) {
.bindEvent({ .bindEvent({
click: function(data) { click: function(data) {
var that = this; var that = this;
that.$element.focus(); // make input trigger change that.focus(); // make input trigger change
setTimeout(function() { 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({ .bindEvent({
change: function(data) { change: function(data) {
var $element = this.$element.parent(); var $element = this.parent();
changeConditionKey( changeConditionKey(
$element.data('position'), $element.data('position'),
$element.data('subposition'), $element.data('subposition'),
@ -582,7 +581,7 @@ Ox.Filter = function(options, self) {
}) })
.bindEvent({ .bindEvent({
change: function(data) { change: function(data) {
var $element = this.$element.parent(); var $element = this.parent();
changeConditionOperator( changeConditionOperator(
$element.data('position'), $element.data('position'),
$element.data('subposition'), $element.data('subposition'),
@ -609,7 +608,7 @@ Ox.Filter = function(options, self) {
submit: change submit: change
}); });
function change(data) { function change(data) {
var $element = this.$element.parent(); var $element = this.parent();
changeConditionValue( changeConditionValue(
$element.data('position'), $element.data('position'),
$element.data('subposition'), $element.data('subposition'),
@ -672,7 +671,7 @@ Ox.Filter = function(options, self) {
}) })
.bindEvent({ .bindEvent({
change: function(data) { change: function(data) {
var $element = this.$element.parent().parent(); var $element = this.parent().parent();
changeGroupOperator( changeGroupOperator(
$element.data('position'), $element.data('position'),
data.value data.value