Files
nairobi/app/assets/javascripts/foundation_extras.js
Javi Martín ec5af1f1bc Remove unnecessary return statements
These statements were automatically added by CoffeeScript.

I'm only removing the obvious cases; there might be more cases where the
`return` statement isn't necessary.
2019-09-11 14:03:24 +02:00

31 lines
807 B
JavaScript

(function() {
"use strict";
App.FoundationExtras = {
clearSticky: function() {
if ($("[data-sticky]").length) {
$("[data-sticky]").foundation("destroy");
}
},
mobile_ui_init: function() {
$(window).trigger("load.zf.sticky");
},
desktop_ui_init: function() {
$(window).trigger("init.zf.sticky");
},
initialize: function() {
$(document).foundation();
$(window).trigger("resize");
$(document).on("page:before-unload", this.clearSticky);
window.addEventListener("popstate", this.clearSticky, false);
$(function() {
if ($(window).width() < 620) {
App.FoundationExtras.mobile_ui_init();
} else {
App.FoundationExtras.desktop_ui_init();
}
});
}
};
}).call(this);