]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
In Toggler, fire on and off events after aria attributes have been updated
authorGeoff Kimball <geoff@zurb.com>
Tue, 1 Mar 2016 18:24:48 +0000 (10:24 -0800)
committerGeoff Kimball <geoff@zurb.com>
Tue, 1 Mar 2016 18:24:48 +0000 (10:24 -0800)
js/foundation.toggler.js

index d6772c429a854b7e08170dd6e95934ee52f33d8f..645b8b267dfa40017b9a6d1e1b868f5bec1b0c85 100644 (file)
@@ -103,19 +103,20 @@ class Toggler {
 
     if (this.$element.is(':hidden')) {
       Foundation.Motion.animateIn(this.$element, this.animationIn, function() {
-        this.trigger('on.zf.toggler');
         _this._updateARIA(true);
+        this.trigger('on.zf.toggler');
       });
     }
     else {
       Foundation.Motion.animateOut(this.$element, this.animationOut, function() {
-        this.trigger('off.zf.toggler');
         _this._updateARIA(false);
+        this.trigger('off.zf.toggler');
       });
     }
   }
 
   _updateARIA(isOn) {
+    console.log(isOn);
     this.$element.attr('aria-expanded', isOn ? true : false);
   }