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