Skip to content

Commit

Permalink
Allow the content with id 0 to be selected
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Weiß committed May 22, 2014
1 parent 7be8a7a commit 1fa5737
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,21 +261,18 @@
if (hash.indexOf('/') !== -1) {
tmp = hash.split('/');
index = tmp.pop();
hash = tmp.join('/');

if (parseInt(index, 10) > 0) {
hash = tmp.join('/');
// Remove the index from the hash...
modalElement = document.getElementById(hash);

// Remove the index from the hash...
modalElement = document.getElementById(hash);

// ... and store the index as a number on the element to
// make it accessible for plugins
if (!modalElement) {
throw new Error('ReferenceError: element "' + hash + '" does not exist!');
}

modalElement.index = (1 * index);
// ... and store the index as a number on the element to
// make it accessible for plugins
if (!modalElement) {
throw new Error('ReferenceError: element "' + hash + '" does not exist!');
}

modalElement.index = (1 * index);
}

// If the hash element exists
Expand Down

0 comments on commit 1fa5737

Please sign in to comment.