Skip to content

Commit

Permalink
Support special symbols in the 'id' attribute (solves vodkabears#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
vodkabears committed Oct 12, 2015
1 parent 234f10b commit a458997
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/remodal.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,7 @@
// Catch syntax error if your hash is bad
try {
$elem = $(
'[data-' + PLUGIN_NAME + '-id=' +
id.replace(new RegExp('/', 'g'), '\\/') + ']'
'[data-' + PLUGIN_NAME + '-id="' + id + '"]'
);
} catch (err) {}

Expand Down Expand Up @@ -737,7 +736,7 @@

var elem = e.currentTarget;
var id = elem.getAttribute('data-' + PLUGIN_NAME + '-target');
var $target = $('[data-' + PLUGIN_NAME + '-id=' + id + ']');
var $target = $('[data-' + PLUGIN_NAME + '-id="' + id + '"]');

$[PLUGIN_NAME].lookup[$target.data(PLUGIN_NAME)].open();
});
Expand Down

0 comments on commit a458997

Please sign in to comment.