Convert CofeeScript to JavaScript
Compiled using `coffee -c` with CoffeeScript 1.12.6.
This commit is contained in:
31
app/assets/javascripts/foundation_extras.js
Normal file
31
app/assets/javascripts/foundation_extras.js
Normal file
@@ -0,0 +1,31 @@
|
||||
// Generated by CoffeeScript 1.12.6
|
||||
(function() {
|
||||
"use strict";
|
||||
App.FoundationExtras = {
|
||||
clearSticky: function() {
|
||||
if ($("[data-sticky]").length) {
|
||||
return $("[data-sticky]").foundation("destroy");
|
||||
}
|
||||
},
|
||||
mobile_ui_init: function() {
|
||||
return $(window).trigger("load.zf.sticky");
|
||||
},
|
||||
desktop_ui_init: function() {
|
||||
return $(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);
|
||||
return $(function() {
|
||||
if ($(window).width() < 620) {
|
||||
return App.FoundationExtras.mobile_ui_init();
|
||||
} else {
|
||||
return App.FoundationExtras.desktop_ui_init();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
}).call(this);
|
||||
Reference in New Issue
Block a user