2013-02-06 03:16:51 +08:00
|
|
|
Discourse.AdminCustomizeView = window.Discourse.View.extend
|
|
|
|
templateName: 'admin/templates/customize'
|
|
|
|
classNames: ['customize']
|
|
|
|
contentBinding: 'controller.content'
|
|
|
|
|
|
|
|
init: ->
|
|
|
|
@_super()
|
|
|
|
@set('selected', 'stylesheet')
|
|
|
|
|
|
|
|
headerActive: (->
|
|
|
|
@get('selected') == 'header'
|
|
|
|
).property('selected')
|
2013-02-07 23:45:24 +08:00
|
|
|
|
2013-02-06 03:16:51 +08:00
|
|
|
stylesheetActive: (->
|
|
|
|
@get('selected') == 'stylesheet'
|
|
|
|
).property('selected')
|
|
|
|
|
|
|
|
selectHeader: ->
|
|
|
|
@set('selected', 'header')
|
|
|
|
|
|
|
|
selectStylesheet: ->
|
|
|
|
@set('selected', 'stylesheet')
|
|
|
|
|
|
|
|
|
|
|
|
didInsertElement: ->
|
|
|
|
Mousetrap.bindGlobal ['meta+s', 'ctrl+s'], =>
|
|
|
|
@get('controller').save()
|
|
|
|
return false
|
2013-02-07 23:45:24 +08:00
|
|
|
|
2013-02-06 03:16:51 +08:00
|
|
|
willDestroyElement: ->
|
|
|
|
Mousetrap.unbindGlobal('meta+s','ctrl+s')
|
|
|
|
|
|
|
|
|