Skip to content

Commit

Permalink
replaced Array.from in pagy.js for extended compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Jul 9, 2018
1 parent 0cf132d commit dd361e1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/pagy/extras/javascripts/pagy.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ Pagy.responsive = function(id, tags, widths, series){

Pagy.init = function(){
['compact', 'items', 'responsive'].forEach(function(name){
Array.from(document.getElementsByClassName("pagy-"+name+"-json")).forEach(function(json) {
Pagy[name].apply(null, JSON.parse(json.innerHTML))
})
var json = document.getElementsByClassName("pagy-"+name+"-json");
for (var i = 0, len = json.length; i < len; i++) {
Pagy[name].apply(null, JSON.parse(json[i].innerHTML))
}
})
};

0 comments on commit dd361e1

Please sign in to comment.