*/
_setSizes(cb) {
this.canStick = Foundation.MediaQuery.atLeast(this.options.stickyOn);
- if (!this.canStick) { cb(); }
+ if (!this.canStick) {
+ if (cb && typeof cb === 'function') { cb(); }
+ }
var _this = this,
newElemWidth = this.$container[0].getBoundingClientRect().width,
comp = window.getComputedStyle(this.$container[0]),
}
this._setBreakPoints(newContainerHeight, function() {
- if (cb) { cb(); }
+ if (cb && typeof cb === 'function') { cb(); }
});
}
*/
_setBreakPoints(elemHeight, cb) {
if (!this.canStick) {
- if (cb) { cb(); }
+ if (cb && typeof cb === 'function') { cb(); }
else { return false; }
}
var mTop = emCalc(this.options.marginTop),
this.topPoint = topPoint;
this.bottomPoint = bottomPoint;
- if (cb) { cb(); }
+ if (cb && typeof cb === 'function') { cb(); }
}
/**