Lungo.Boot.Device.coffee 562 B

123456789101112131415161718192021222324252627
  1. ###
  2. @todo
  3. @namespace Lungo.Boot
  4. @class Device
  5. @author Javier Jimenez Villar <javi@tapquo.com> || @soyjavi
  6. ###
  7. Lungo.Boot.Device = do(lng = Lungo) ->
  8. DEVICE = lng.Constants.DEVICE
  9. ###
  10. @todo
  11. @method init
  12. ###
  13. init = ->
  14. env = lng.Core.environment()
  15. lng.DEVICE = (if env.screen.width < 768 then DEVICE.PHONE else DEVICE.TABLET)
  16. body = lng.dom document.body
  17. body.data "device", lng.DEVICE
  18. if env.os then body.data "os", env.os.name.toLowerCase()
  19. lng.Aside.draggable() if lng.DEVICE is lng.Constants.DEVICE.PHONE
  20. init: init