From efa8c8ca41406a69a400a4a5083dfb82d1299198 Mon Sep 17 00:00:00 2001 From: Neil Merchant Date: Fri, 22 Jan 2016 13:20:02 -0500 Subject: [PATCH 1/2] Add data to thumbnail element, return data on thumbnail_getSelectedItems --- js/repeater-thumbnail.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/repeater-thumbnail.js b/js/repeater-thumbnail.js index 6d82f7cfe..e9940bee7 100755 --- a/js/repeater-thumbnail.js +++ b/js/repeater-thumbnail.js @@ -36,7 +36,10 @@ $.fn.repeater.Constructor.prototype.thumbnail_getSelectedItems = function () { var selected = []; this.$canvas.find('.repeater-thumbnail-cont .selectable.selected').each(function () { - selected.push($(this)); + selected.push( { + element: $(this) + , data: $(this).data('item_data') + } ); }); return selected; }; @@ -166,6 +169,8 @@ var selected = 'selected'; var self = this; var $thumbnail = $(fillTemplate(helpers.subset[helpers.index], this.viewOptions.thumbnail_template)); + + $thumbnail.data('item_data', helpers.data.items[helpers.index]); if (selectable) { $thumbnail.addClass('selectable'); From 6bc8485910e899750d80adeefe0bffd87811c869 Mon Sep 17 00:00:00 2001 From: Neil Merchant Date: Fri, 22 Jan 2016 14:18:22 -0500 Subject: [PATCH 2/2] Leave getSelectedItems as is - not ideal but works without it breaking for existing users --- js/repeater-thumbnail.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/js/repeater-thumbnail.js b/js/repeater-thumbnail.js index e9940bee7..026b6c615 100755 --- a/js/repeater-thumbnail.js +++ b/js/repeater-thumbnail.js @@ -36,10 +36,7 @@ $.fn.repeater.Constructor.prototype.thumbnail_getSelectedItems = function () { var selected = []; this.$canvas.find('.repeater-thumbnail-cont .selectable.selected').each(function () { - selected.push( { - element: $(this) - , data: $(this).data('item_data') - } ); + selected.push($(this)); }); return selected; };