Skip to content

Commit

Permalink
Remove DOM condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Dec 26, 2015
1 parent cc39970 commit 9158cf7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions assets/js/src/__init.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ window.Itch = Itch =
is: (property, value) -> this.app.dataset[property] is value
app: do -> document.body

$ ->
Itch.context = ->
context: ->
# get the context from the first class name of body
# https://github.com/TryGhost/Ghost/wiki/Context-aware-Filters-and-Helpers
className = document.body.className.split(' ')[0].split('-')[0]
if className is '' then 'error' else className

Itch.device = ->
device: ->
w = window.innerWidth
h = window.innerHeight
return 'mobile' if (w <= 480)
Expand Down

0 comments on commit 9158cf7

Please sign in to comment.