]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Fix setting up of an empty equalized list #8521 8526/head
authorNicolas Coden <nicos.coden@neuf.fr>
Tue, 5 Apr 2016 02:09:44 +0000 (04:09 +0200)
committerNicolas Coden <nicos.coden@neuf.fr>
Tue, 5 Apr 2016 02:09:44 +0000 (04:09 +0200)
Fix https://github.com/zurb/foundation-sites/issues/8521

js/foundation.equalizer.js

index 0893c557305deb31f2ab1791fc02a66bd52e9f0d..3c51537d32f7a916d7a47ad59fb6cfaeddeb046e 100644 (file)
@@ -155,7 +155,7 @@ class Equalizer {
    * @returns {Array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child
    */
   getHeightsByRow(cb) {
-    var lastElTopOffset = this.$watched.first().offset().top,
+    var lastElTopOffset = (this.$watched.length ? this.$watched.first().offset().top : 0),
         groups = [],
         group = 0;
     //group by Row