project-nexus
Version:
A hub for all your programming projects
35 lines (26 loc) • 798 B
text/coffeescript
win = nw.Window.get()
class extends React.Component
constructor: ->
= maximized: no
render: ->
E ".titlebar",
E TitleButton,
key: "close"
action: -> window.close()
icon: "close"
.children ? E ".title", document.title
E TitleButton,
if .maximized
key: "maximization"
action: -> win.restore()
icon: "restore"
else
key: "maximization"
action: -> win.maximize()
icon: "fullscreen"
componentDidMount: ->
win.on "maximize", = => maximized: yes
win.on "unmaximize", = => maximized: no
componentWillUnmount: ->
win.removeListener "maximize",
win.removeListener "unmaximize",