diff --git a/source/Ox.UI/js/List/CustomList.js b/source/Ox.UI/js/List/CustomList.js index e243ddaf..f121697f 100644 --- a/source/Ox.UI/js/List/CustomList.js +++ b/source/Ox.UI/js/List/CustomList.js @@ -108,6 +108,11 @@ Ox.CustomList = function(options, self) { return self.$list.hasFocus(); }; + that.invertSelection = function() { + self.$list.invertSelection(); + return that; + }; + /*@ loseFocus lose Focus @*/ @@ -116,6 +121,11 @@ Ox.CustomList = function(options, self) { return that; }; + that.selectAll = function() { + self.$list.selectAll(); + return that; + }; + /*@ selectPosition select position @*/ diff --git a/source/Ox.UI/js/List/IconList.js b/source/Ox.UI/js/List/IconList.js index 4494953a..e0080fdc 100644 --- a/source/Ox.UI/js/List/IconList.js +++ b/source/Ox.UI/js/List/IconList.js @@ -184,6 +184,11 @@ Ox.IconList = function(options, self) { return that.$element.hasFocus(); }; + that.invertSelection = function() { + that.$element.invertSelection(); + return that; + }; + /*@ loseFocus loseFocus @*/ @@ -210,6 +215,11 @@ Ox.IconList = function(options, self) { return that; }; + that.selectAll = function() { + that.$element.selectAll(); + return that; + }; + /*@ size get size of list () -> size diff --git a/source/Ox.UI/js/List/InfoList.js b/source/Ox.UI/js/List/InfoList.js index 92c7d60b..b8976711 100644 --- a/source/Ox.UI/js/List/InfoList.js +++ b/source/Ox.UI/js/List/InfoList.js @@ -205,6 +205,11 @@ Ox.InfoList = function(options, self) { return that.$element.hasFocus(); }; + that.invertSelection = function() { + that.$element.invertSelection(); + return that; + }; + /*@ loseFocus loseFocus @*/ @@ -229,6 +234,11 @@ Ox.InfoList = function(options, self) { return that; }; + that.selectAll = function() { + that.$element.selectAll(); + return that; + }; + /*@ size size @*/ diff --git a/source/Ox.UI/js/List/List.js b/source/Ox.UI/js/List/List.js index 092702d2..d26f4f78 100644 --- a/source/Ox.UI/js/List/List.js +++ b/source/Ox.UI/js/List/List.js @@ -36,6 +36,9 @@ Ox.List List constructor ([options[, self]]) -> List object init init add item added + closepreview preview closed + copy copy and replace clipboard + copyadd copy and add to clipboard delete item removed draganddrop Fires during drag draganddropend Fires on drop @@ -43,12 +46,10 @@ Ox.List List constructor draganddropleave Fires when leaving an item during drag draganddroppause Fires when the mouse stops during drag draganddropstart Fires when drag starts - copy copy paste paste - move move item load list loaded + move move item openpreview preview of selected item opened - closepreview preview closed select select item selectnext selectnext selectprevious selectprevious @@ -219,8 +220,12 @@ Ox.List = function(options, self) { }); } self.options.max == -1 && Ox.extend(self.keyboardEvents, { - key_alt_control_a: invertSelection, - key_control_a: selectAll + key_alt_control_a: function() { + that.invertSelection(); + }, + key_control_a: function() { + that.selectAll(); + } }); self.options.min == 0 && Ox.extend(self.keyboardEvents, { key_control_shift_a: selectNone @@ -782,14 +787,6 @@ Ox.List = function(options, self) { ); } - function invertSelection() { - var arr = Ox.range(self.listLength).filter(function(pos) { - return !isSelected(pos); - }); - selectNone(); - addToSelection(arr); - } - function isSelected(pos) { return self.selected.indexOf(pos) > -1; } @@ -1161,10 +1158,6 @@ Ox.List = function(options, self) { } } - function selectAll() { - addToSelection(Ox.range(self.listLength)); - } - function selectAsYouType(data) { self.options.items({ keys: [self.options.unique], @@ -1589,7 +1582,7 @@ Ox.List = function(options, self) { /*@ closePreview to be called when preview is closed externally - () -> the list + () -> the list @*/ that.closePreview = function() { self.preview = false; @@ -1606,6 +1599,19 @@ Ox.List = function(options, self) { return that; }; + /*@ + invertSelection Invert selection + () -> The list + @*/ + that.invertSelection = function() { + var arr = Ox.range(self.listLength).filter(function(pos) { + return !isSelected(pos); + }); + selectNone(); + addToSelection(arr); + return that; + }; + /*@ openPreview to be called when preview is opened externally () -> the list @@ -1699,6 +1705,15 @@ Ox.List = function(options, self) { return that; }; + /*@ + selectAll Select all + () -> The list + @*/ + that.selectAll = function() { + addToSelection(Ox.range(self.listLength)); + return that; + }; + /*@ selectPosition select position (pos) -> List Object diff --git a/source/Ox.UI/js/List/TableList.js b/source/Ox.UI/js/List/TableList.js index 038cee92..8d733c1b 100644 --- a/source/Ox.UI/js/List/TableList.js +++ b/source/Ox.UI/js/List/TableList.js @@ -1081,6 +1081,11 @@ Ox.TableList = function(options, self) { return that.$body.hasFocus(); }; + that.invertSelection = function() { + that.$body.invertSelection(); + return that; + }; + /*@ loseFocus loseFocus @*/ @@ -1111,6 +1116,11 @@ Ox.TableList = function(options, self) { return that; }; + that.selectAll = function() { + that.$body.selectAll(); + return that; + }; + that.selectPosition = function(pos) { that.$body.selectPosition(pos); return that;