"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/templates/package-coffeescript/lib/__package-name__.coffee.template" (8 Mar 2017, 1039 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 __PackageName__View = require './__package-name__-view'
    2 {CompositeDisposable} = require 'atom'
    3 
    4 module.exports = __PackageName__ =
    5   __packageName__View: null
    6   modalPanel: null
    7   subscriptions: null
    8 
    9   activate: (state) ->
   10     @__packageName__View = new __PackageName__View(state.__packageName__ViewState)
   11     @modalPanel = atom.workspace.addModalPanel(item: @__packageName__View.getElement(), visible: false)
   12 
   13     # Events subscribed to in atom's system can be easily cleaned up with a CompositeDisposable
   14     @subscriptions = new CompositeDisposable
   15 
   16     # Register command that toggles this view
   17     @subscriptions.add atom.commands.add 'atom-workspace', '__package-name__:toggle': => @toggle()
   18 
   19   deactivate: ->
   20     @modalPanel.destroy()
   21     @subscriptions.dispose()
   22     @__packageName__View.destroy()
   23 
   24   serialize: ->
   25     __packageName__ViewState: @__packageName__View.serialize()
   26 
   27   toggle: ->
   28     console.log '__PackageName__ was toggled!'
   29 
   30     if @modalPanel.isVisible()
   31       @modalPanel.hide()
   32     else
   33       @modalPanel.show()