Arrow notation makes `bind(this)` statement obsolete, so it can be replaced with an anonymous function calling `_reflow()`, which allows using a `sinon.spy` during the unit tests.
* @private
*/
_events() {
- $(window).on('resize.zf.interchange', Foundation.util.throttle(this._reflow.bind(this), 50));
+ $(window).on('resize.zf.interchange', Foundation.util.throttle(() => {
+ this._reflow();
+ }, 50));
}
/**
for (var i in this.rules) {
if(this.rules.hasOwnProperty(i)) {
var rule = this.rules[i];
-
if (window.matchMedia(rule.query).matches) {
match = rule;
}