From 603dfa3d3a7b47b23719fd307c72d26634437153 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 12 Feb 2014 13:56:54 +0000 Subject: [PATCH] Lists: Add getPasteIndex method --- source/Ox.UI/js/List/CustomList.js | 4 ++++ source/Ox.UI/js/List/IconList.js | 4 ++++ source/Ox.UI/js/List/InfoList.js | 4 ++++ source/Ox.UI/js/List/List.js | 6 ++++++ source/Ox.UI/js/List/TableList.js | 4 ++++ 5 files changed, 22 insertions(+) diff --git a/source/Ox.UI/js/List/CustomList.js b/source/Ox.UI/js/List/CustomList.js index c15a16dc..75ba9500 100644 --- a/source/Ox.UI/js/List/CustomList.js +++ b/source/Ox.UI/js/List/CustomList.js @@ -101,6 +101,10 @@ Ox.CustomList = function(options, self) { return that; }; + that.getPasteIndex = function() { + return self.$list.getPasteIndex(); + }; + /*@ hasFocus has Focus @*/ diff --git a/source/Ox.UI/js/List/IconList.js b/source/Ox.UI/js/List/IconList.js index 4cb571bd..42598f45 100644 --- a/source/Ox.UI/js/List/IconList.js +++ b/source/Ox.UI/js/List/IconList.js @@ -177,6 +177,10 @@ Ox.IconList = function(options, self) { return that; }; + that.getPasteIndex = function() { + return that.$element.getPasteIndex(); + }; + /*@ hasFocus hasFocus @*/ diff --git a/source/Ox.UI/js/List/InfoList.js b/source/Ox.UI/js/List/InfoList.js index 540963d0..b4517e53 100644 --- a/source/Ox.UI/js/List/InfoList.js +++ b/source/Ox.UI/js/List/InfoList.js @@ -198,6 +198,10 @@ Ox.InfoList = function(options, self) { return that; }; + that.getPasteIndex = function() { + return that.$element.getPasteIndex(); + }; + /*@ hasFocus hasFocus @*/ diff --git a/source/Ox.UI/js/List/List.js b/source/Ox.UI/js/List/List.js index 178e98da..d3d3507e 100644 --- a/source/Ox.UI/js/List/List.js +++ b/source/Ox.UI/js/List/List.js @@ -1589,6 +1589,12 @@ Ox.List = function(options, self) { return that; }; + that.getPasteIndex = function() { + return self.selected.length + ? Ox.max(self.selected) + 1 + : self.items.length; + }; + /*@ invertSelection Invert selection () -> The list diff --git a/source/Ox.UI/js/List/TableList.js b/source/Ox.UI/js/List/TableList.js index af2cf664..0bff8ddf 100644 --- a/source/Ox.UI/js/List/TableList.js +++ b/source/Ox.UI/js/List/TableList.js @@ -1074,6 +1074,10 @@ Ox.TableList = function(options, self) { return self.columnWidths[pos]; }; + that.getPasteIndex = function() { + return that.$body.getPasteIndex(); + }; + // FIXME: needed? that.getVisibleColumns = function() { return self.visibleColumns.map(function(column) {