2013-02-21 02:15:50 +08:00
|
|
|
/*global Mousetrap:true */
|
2013-02-23 04:41:12 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
A view to handle site customizations
|
|
|
|
|
2013-03-02 01:45:25 +08:00
|
|
|
@class AdminCustomizeView
|
|
|
|
@extends Discourse.View
|
2013-02-23 04:41:12 +08:00
|
|
|
@namespace Discourse
|
|
|
|
@module Discourse
|
2013-03-02 01:45:25 +08:00
|
|
|
**/
|
2013-02-23 04:41:12 +08:00
|
|
|
Discourse.AdminCustomizeView = Discourse.View.extend({
|
|
|
|
templateName: 'admin/templates/customize',
|
|
|
|
classNames: ['customize'],
|
2014-01-22 23:52:09 +08:00
|
|
|
selected: 'stylesheet',
|
2014-04-16 21:49:06 +08:00
|
|
|
headerActive: Em.computed.equal('selected', 'header'),
|
|
|
|
stylesheetActive: Em.computed.equal('selected', 'stylesheet'),
|
2014-01-22 23:52:09 +08:00
|
|
|
mobileHeaderActive: Em.computed.equal('selected', 'mobileHeader'),
|
|
|
|
mobileStylesheetActive: Em.computed.equal('selected', 'mobileStylesheet'),
|
|
|
|
|
|
|
|
actions: {
|
2014-04-16 21:49:06 +08:00
|
|
|
selectHeader: function() { this.set('selected', 'header'); },
|
|
|
|
selectStylesheet: function() { this.set('selected', 'stylesheet'); },
|
2014-01-22 23:52:09 +08:00
|
|
|
selectMobileHeader: function() { this.set('selected', 'mobileHeader'); },
|
2014-03-19 09:21:10 +08:00
|
|
|
selectMobileStylesheet: function() { this.set('selected', 'mobileStylesheet'); }
|
2013-09-17 00:21:49 +08:00
|
|
|
},
|
|
|
|
|
2013-02-23 04:41:12 +08:00
|
|
|
didInsertElement: function() {
|
2013-06-08 00:13:46 +08:00
|
|
|
var controller = this.get('controller');
|
2014-01-22 23:52:09 +08:00
|
|
|
Mousetrap.bindGlobal('mod+s', function() {
|
|
|
|
controller.send("save");
|
2013-02-23 04:41:12 +08:00
|
|
|
return false;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
willDestroyElement: function() {
|
2014-01-22 23:52:09 +08:00
|
|
|
Mousetrap.unbindGlobal('mod+s');
|
2013-02-23 04:41:12 +08:00
|
|
|
}
|
2013-03-02 01:45:25 +08:00
|
|
|
|
2013-02-23 04:41:12 +08:00
|
|
|
});
|