From f557733be6101452a5aa624d7a869764bba00b7b Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Wed, 24 Sep 2014 20:17:57 +0200 Subject: [PATCH] that. -> self. --- source/Ox.UI/js/List/InfoList.js | 48 ++++++++++++++++---------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/source/Ox.UI/js/List/InfoList.js b/source/Ox.UI/js/List/InfoList.js index acc108e4..4b0e2f61 100644 --- a/source/Ox.UI/js/List/InfoList.js +++ b/source/Ox.UI/js/List/InfoList.js @@ -31,17 +31,17 @@ Ox.InfoList = function(options, self) { .options(options || {}) .update({ items: function() { - that.$element.options({items: self.options.items}); + self.$list.options({items: self.options.items}); }, query: function() { - that.$element.options({query: self.options.query}); + self.$list.options({query: self.options.query}); }, selected: function() { - that.$element.options({selected: self.options.selected}); + self.$list.options({selected: self.options.selected}); }, sort: function() { updateKeys(); - that.$element.options({sort: self.options.sort}); + self.$list.options({sort: self.options.sort}); }, width: function() { // FIXME: don't use classname for this lookup @@ -61,7 +61,7 @@ Ox.InfoList = function(options, self) { self.itemHeight = self.options.size; that.setElement( - Ox.List({ + self.$list = Ox.List({ construct: constructItem, draggable: self.options.draggable, id: self.options.id, @@ -167,16 +167,16 @@ Ox.InfoList = function(options, self) { function getItemWidth(cached) { if (!cached) { - self.cachedWidth = that.$element.width() - Ox.UI.SCROLLBAR_SIZE; + self.cachedWidth = self.$list.width() - Ox.UI.SCROLLBAR_SIZE; } else if (!self.cachedWidth || self.cachedWidthTime < +new Date() - 5000) { - self.cachedWidth = that.$element.width() - Ox.UI.SCROLLBAR_SIZE; + self.cachedWidth = self.$list.width() - Ox.UI.SCROLLBAR_SIZE; self.cachedWidthTime = +new Date(); } return self.cachedWidth; } function updateKeys() { - that.$element.options({ + self.$list.options({ keys: Ox.unique( [self.options.sort[0].key].concat(self.options.keys) ) @@ -187,7 +187,7 @@ Ox.InfoList = function(options, self) { closePreview closePreview @*/ that.closePreview = function() { - that.$element.closePreview(); + self.$list.closePreview(); return that; }; @@ -195,23 +195,23 @@ Ox.InfoList = function(options, self) { gainFocus gainFocus @*/ that.gainFocus = function() { - that.$element.gainFocus(); + self.$list.gainFocus(); return that; }; that.getPasteIndex = function() { - return that.$element.getPasteIndex(); + return self.$list.getPasteIndex(); }; /*@ hasFocus hasFocus @*/ that.hasFocus = function() { - return that.$element.hasFocus(); + return self.$list.hasFocus(); }; that.invertSelection = function() { - that.$element.invertSelection(); + self.$list.invertSelection(); return that; }; @@ -219,7 +219,7 @@ Ox.InfoList = function(options, self) { loseFocus loseFocus @*/ that.loseFocus = function() { - that.$element.loseFocus(); + self.$list.loseFocus(); return that; }; @@ -227,7 +227,7 @@ Ox.InfoList = function(options, self) { reloadList reloadList @*/ that.reloadList = function(stayAtPosition) { - that.$element.reloadList(stayAtPosition); + self.$list.reloadList(stayAtPosition); return that; }; @@ -235,22 +235,22 @@ Ox.InfoList = function(options, self) { scrollToSelection scrollToSelection @*/ that.scrollToSelection = function() { - that.$element.scrollToSelection(); + self.$list.scrollToSelection(); return that; }; that.selectAll = function() { - that.$element.selectAll(); + self.$list.selectAll(); return that; }; that.selectPosition = function(pos) { - that.$element.selectPosition(pos); + self.$list.selectPosition(pos); return that; }; that.selectSelected = function(offset) { - that.$element.selectSelected(offset); + self.$list.selectSelected(offset); return that; }; @@ -258,7 +258,7 @@ Ox.InfoList = function(options, self) { size size @*/ that.size = function() { - that.$element.size(); + self.$list.size(); return that; }; @@ -272,7 +272,7 @@ Ox.InfoList = function(options, self) { operator: operator }]; updateKeys(); - that.$element.sortList(key, operator); + self.$list.sortList(key, operator); return that; }; @@ -287,12 +287,12 @@ Ox.InfoList = function(options, self) { var args = Ox.slice(arguments), id = args.shift(); if (arguments.length == 1) { - return that.$element.value(id); + return self.$list.value(id); } else if (arguments.length == 2 && Ox.isString(arguments[1])) { - return that.$element.value(id, arguments[1]); + return self.$list.value(id, arguments[1]); } else { Ox.forEach(Ox.makeObject(args), function(value, key) { - that.$element.value(id, key, value); + self.$list.value(id, key, value); }); return that; }