Skip to content

Commit

Permalink
Improve Bloggy instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Jan 6, 2016
1 parent 5a8323f commit 39fc0fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 6 additions & 1 deletion assets/js/src/__init.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

window.Bloggy = Bloggy =
version: '0.1.0'
is: (property, value) -> this.app.dataset[property] is value
is: (k, v=!'undefined') -> this.app.dataset[k] is v
app: do -> document.body

context: ->
Expand All @@ -17,3 +17,8 @@ window.Bloggy = Bloggy =
return 'mobile' if (w <= 480)
return 'tablet' if (w <= 1024)
'desktop'

Bloggy.app.dataset.page = Bloggy.context()
Bloggy.app.device = Bloggy.device()

$('#newsletter_form').attr('action', window.newsletter_form) if (window.newsletter_form)
8 changes: 1 addition & 7 deletions assets/js/src/main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@ $(window).load ->
$(this)[method] 'full-img'

$(this).smartresize casperFullImg
$('#newsletter_form').attr('action', window.newsletter_form) if (window.newsletter_form)

$ ->
el = Bloggy.app
el.dataset.page = Bloggy.context()
el.dataset.device = Bloggy.device()

$('.post-content').fitVids()

FastClick.attach el unless Bloggy.is 'device', 'desktop'
FastClick.attach Bloggy.app unless Bloggy.is 'device', 'desktop'

0 comments on commit 39fc0fb

Please sign in to comment.