Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions dist/jquery.magnific-popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,18 @@ MagnificPopup.prototype = {
var i;

if(data.isObj === false) {

//remove items where the href is empty. EX. <a href="#" ...
for(i = 0; i < data.items.length; i++){
it = data.items[i];
if( it.href.substr(it.href.length -1 , 1) === '#'){
//remove it
data.items.splice(i,1);
//decrement i because you just removed an element from the array.
i--;
}
}

// convert jQuery collection to array to avoid conflicts later
mfp.items = data.items.toArray();

Expand Down
12 changes: 12 additions & 0 deletions src/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,18 @@ MagnificPopup.prototype = {
var i;

if(data.isObj === false) {

//remove items where the href is empty. EX. <a href="#" ...
for(i = 0; i < data.items.length; i++){
var it = data.items[i];
if( it.href.substr(it.href.length -1 , 1) === '#'){
//remove it
data.items.splice(i,1);
//decrement i because you just removed an element from the array.
i--;
}
}

// convert jQuery collection to array to avoid conflicts later
mfp.items = data.items.toArray();

Expand Down