Strict mode is supported by 98% of the browsers, including Internet Explorer 10, and it helps developers avoid common JavaScript pitfalls.
24 lines
601 B
CoffeeScript
24 lines
601 B
CoffeeScript
"use strict"
|
|
|
|
App.FoundationExtras =
|
|
clearSticky: ->
|
|
$("[data-sticky]").foundation("destroy") if $("[data-sticky]").length
|
|
|
|
mobile_ui_init: ->
|
|
$(window).trigger "load.zf.sticky"
|
|
|
|
desktop_ui_init: ->
|
|
$(window).trigger "init.zf.sticky"
|
|
|
|
initialize: ->
|
|
$(document).foundation()
|
|
$(window).trigger "resize"
|
|
$(document).on("page:before-unload", this.clearSticky)
|
|
window.addEventListener("popstate", this.clearSticky, false)
|
|
|
|
$ ->
|
|
if $(window).width() < 620
|
|
App.FoundationExtras.mobile_ui_init()
|
|
else
|
|
App.FoundationExtras.desktop_ui_init()
|