From 23dc8d12dff9f643d27922502089ec53f4e280b7 Mon Sep 17 00:00:00 2001 From: Nick Stakenburg Date: Thu, 15 Mar 2018 00:42:02 +0100 Subject: [PATCH] fixed a bug that made it impossible to dynamically change data-strip-group --- bower.json | 4 ++-- package.json | 2 +- src/js/api.js | 2 +- src/js/pages.js | 2 +- src/js/view.js | 10 +++++----- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bower.json b/bower.json index 4c9bdc2..cc0fa50 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "strip", "description": "An Unobtrusive Responsive Lightbox", - "version": "1.6.4", + "version": "1.6.5", "homepage": "http://stripjs.com", "keywords": [ "lightbox", @@ -28,4 +28,4 @@ "dependencies": { "jquery": "^1.11.3" } -} \ No newline at end of file +} diff --git a/package.json b/package.json index ae3bb3a..d286017 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@staaky/strip", "title": "Strip", - "version": "1.6.4", + "version": "1.6.5", "description": "An Unobtrusive Responsive Lightbox", "homepage": "http://stripjs.com", "author": { diff --git a/src/js/api.js b/src/js/api.js index 2a665dd..0c952ac 100644 --- a/src/js/api.js +++ b/src/js/api.js @@ -62,7 +62,7 @@ var _Strip = { // if we have an element, look for other elements if (isElement) { - var elements = $('.strip[data-strip-group="' + $(object).data('strip-group') + '"]'); + var elements = $('.strip[data-strip-group="' + $(object).attr('data-strip-group') + '"]'); // find possible group options var groupOptions = {}; diff --git a/src/js/pages.js b/src/js/pages.js index 4387e23..631c892 100644 --- a/src/js/pages.js +++ b/src/js/pages.js @@ -175,7 +175,7 @@ var Pages = { $(element).addClass('strip-active-element strip-active-group'); // also give other items in the group the active group class - var group = $(element).data('strip-group'); + var group = $(element).attr('data-strip-group'); if (group) { $('.strip[data-strip-group="' + group + '"]').addClass('strip-active-group'); } diff --git a/src/js/view.js b/src/js/view.js index ae9253d..024a52c 100644 --- a/src/js/view.js +++ b/src/js/view.js @@ -17,11 +17,11 @@ $.extend(View.prototype, { object = { element: element[0], url: element.attr('href'), - caption: element.data('strip-caption'), - group: element.data('strip-group'), - extension: element.data('strip-extension'), - type: element.data('strip-type'), - options: (element.data('strip-options') && eval('({' + element.data('strip-options') + '})')) || {} + caption: element.attr('data-strip-caption'), + group: element.attr('data-strip-group'), + extension: element.attr('data-strip-extension'), + type: element.attr('data-strip-type'), + options: (element.attr('data-strip-options') && eval('({' + element.attr('data-strip-options') + '})')) || {} }; }