From 4a9400cbd91a41a130928e5c7f8266f6a4c3c2f1 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Mon, 22 Sep 2014 13:20:52 +0200 Subject: [PATCH] IconList: that. -> self. --- source/Ox.UI/js/List/IconList.js | 54 ++++++++++++++++---------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/source/Ox.UI/js/List/IconList.js b/source/Ox.UI/js/List/IconList.js index e5a5bb6a..ebed732e 100644 --- a/source/Ox.UI/js/List/IconList.js +++ b/source/Ox.UI/js/List/IconList.js @@ -58,17 +58,17 @@ Ox.IconList = 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}); } }); @@ -91,8 +91,7 @@ Ox.IconList = function(options, self) { self.itemWidth = self.options.size; self.itemHeight = self.iconHeight + self.options.size * 0.5; - that.setElement( - Ox.List({ + self.$list = Ox.List({ centered: self.options.centered, // fixme: change all occurences of construct to render construct: constructItem, @@ -120,8 +119,9 @@ Ox.IconList = function(options, self) { self.options.selected = data.ids; } that.triggerEvent(event, data); - }) - ); + }); + + that.setElement(self.$list); updateKeys(); @@ -153,7 +153,7 @@ Ox.IconList = function(options, self) { } function updateKeys() { - that.$element.options({ + self.$list.options({ keys: Ox.unique( [self.options.sort[0].key].concat(self.options.keys) ) @@ -165,7 +165,7 @@ Ox.IconList = function(options, self) { () -> the list @*/ that.closePreview = function() { - that.$element.closePreview(); + self.$list.closePreview(); return that; }; @@ -173,23 +173,23 @@ Ox.IconList = 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; }; @@ -197,7 +197,7 @@ Ox.IconList = function(options, self) { loseFocus loseFocus @*/ that.loseFocus = function() { - that.$element.loseFocus(); + self.$list.loseFocus(); return that; }; @@ -205,7 +205,7 @@ Ox.IconList = function(options, self) { openPreview openPreview @*/ that.openPreview = function() { - that.$element.openPreview(); + self.$list.openPreview(); return that; }; @@ -214,7 +214,7 @@ Ox.IconList = function(options, self) { () -> the list @*/ that.reloadList = function() { - that.$element.reloadList(); + self.$list.reloadList(); return that; }; @@ -223,22 +223,22 @@ Ox.IconList = function(options, self) { () -> the list @*/ 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; }; @@ -247,7 +247,7 @@ Ox.IconList = function(options, self) { () -> size @*/ that.size = function() { - that.$element.size(); + self.$list.size(); return that; }; @@ -264,7 +264,7 @@ Ox.IconList = function(options, self) { operator: operator }]; updateKeys(); - that.$element.sortList(key, operator); + self.$list.sortList(key, operator); return that; }; @@ -280,12 +280,12 @@ Ox.IconList = function(options, self) { id = args.shift(), sort = false; 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); if (key == self.unique) { // unique id has changed self.options.selected = self.options.selected.map(function(id_) { @@ -298,7 +298,7 @@ Ox.IconList = function(options, self) { sort = true; } }); - sort && that.$element.sort(); + sort && self.$list.sort(); return that; } };