Sha256: a23be49de44f8431d68eb5f2bf988d62ea483f0a2047a7b5fbcda2f2bf6b279a

Contents?: true

Size: 515 Bytes

Versions: 2

Compression:

Stored size: 515 Bytes

Contents

angular.module("SWAT").factory "GlobalControl", ($cookies)->
  class GlobalControl
    constructor: ->
      @initStatus()
      @setReloader(->{})

    initStatus: ->
      status = $cookies.get('MainMenuStatus') || 'closed';
      @setStatus(status)

    toggle: ->
      @setStatus(if @status == 'closed' then 'opened' else 'closed')

    setStatus: (value)->
      $cookies.put('MainMenuStatus', value);
      @status = value

    setReloader: (func)->
      @reloader = func

    reload: ->
      @reloader()

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sw2at-ui-0.0.14 app/assets/javascripts/swat/app/factories/global_control.coffee
sw2at-ui-0.0.13 app/assets/javascripts/swat/app/factories/global_control.coffee