]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Merge remote-tracking branch 'zurb/develop' into fix/on-load-listeners 11077/head
authorNicolas Coden <nicolas@ncoden.fr>
Fri, 23 Mar 2018 09:08:20 +0000 (10:08 +0100)
committerNicolas Coden <nicolas@ncoden.fr>
Fri, 23 Mar 2018 09:08:20 +0000 (10:08 +0100)
1  2 
gulp/tasks/javascript.js
js/foundation.magellan.js

Simple merge
index 001d1dadd06dc621326d2641da866d264bd34d7d,471728804566d49c694e491b5408c9ad03089374..288729a63596d9ad9a08408b289a5485d9a89465
@@@ -94,19 -93,28 +94,19 @@@ class Magellan extends Plugin 
        _this._updateActive();
      });
  
 -    if (document.readyState === "complete") {
 -      _this.$element.on({
 -        'resizeme.zf.trigger': _this.reflow.bind(_this),
 -        'scrollme.zf.trigger': _this._updateActive.bind(_this)
 -      }).on('click.zf.magellan', 'a[href^="#"]', function(e) {
 -        e.preventDefault();
 -        var arrival = this.getAttribute('href');
 -        _this.scrollToLoc(arrival);
 -      });
 -    } else {
 -      $(window).one('load', function(){
 -        _this.$element.on({
 +    _this.onLoadListener = onLoad($(window), function () {
 +      _this.$element
 +        .on({
            'resizeme.zf.trigger': _this.reflow.bind(_this),
            'scrollme.zf.trigger': _this._updateActive.bind(_this)
 -        }).on('click.zf.magellan', 'a[href^="#"]', function(e) {
 +        })
 +        .on('click.zf.magellan', 'a[href^="#"]', function (e) {
            e.preventDefault();
-           var arrival   = _this.getAttribute('href');
+           var arrival this.getAttribute('href');
            _this.scrollToLoc(arrival);
          });
 -      });
 -    }
 -    
 +    });
 +
      this._deepLinkScroll = function(e) {
        if(_this.options.deepLinking) {
          _this.scrollToLoc(window.location.hash);