From 4e90479ad2a185efb98a9e4b0bd83407ffeba2df Mon Sep 17 00:00:00 2001 From: Victor Häggqvist Date: Thu, 26 Jun 2014 17:53:57 +0200 Subject: regex fix --- js/touch-imagelightbox.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/touch-imagelightbox.js b/js/touch-imagelightbox.js index d82b133..db4b60c 100644 --- a/js/touch-imagelightbox.js +++ b/js/touch-imagelightbox.js @@ -72,8 +72,8 @@ inProgress = false, isTargetValid = function( element ) { - this.regexValidObject = /(\.(' + options.allowedTypes + ')$)/; - return $( element ).prop( 'tagName' ).toLowerCase() === 'a' && this.regexValidObject.test($(element).attr('href') ); + options.regexValidObject = new RegExp("(\.("+options.allowedTypes+")$)"); + return $( element ).prop( 'tagName' ).toLowerCase() === 'a' && options.regexValidObject.test($(element).attr('href') ); }, setImage = function() { @@ -329,4 +329,4 @@ return this; }; -})( jQuery, window, document ); +})( jQuery, window, document ); \ No newline at end of file -- cgit v1.2.3