mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 01:24:03 +08:00
f3b72f5d96
This reverts commit 6ee2849df6
.
55 lines
1.8 KiB
JavaScript
55 lines
1.8 KiB
JavaScript
/*global Mousetrap:true */
|
|
|
|
/**
|
|
A view to handle site customizations
|
|
|
|
@class AdminCustomizeView
|
|
@extends Discourse.View
|
|
@namespace Discourse
|
|
@module Discourse
|
|
**/
|
|
Discourse.AdminCustomizeView = Discourse.View.extend({
|
|
templateName: 'admin/templates/customize',
|
|
classNames: ['customize'],
|
|
selected: 'stylesheet',
|
|
|
|
headerActive: Em.computed.equal('selected', 'header'),
|
|
footerActive: Em.computed.equal('selected', 'footer'),
|
|
stylesheetActive: Em.computed.equal('selected', 'stylesheet'),
|
|
mobileHeaderActive: Em.computed.equal('selected', 'mobileHeader'),
|
|
mobileFooterActive: Em.computed.equal('selected', 'mobileFooter'),
|
|
mobileStylesheetActive: Em.computed.equal('selected', 'mobileStylesheet'),
|
|
|
|
actions: {
|
|
selectHeader: function() { this.set('selected', 'header'); },
|
|
selectFooter: function() { this.set('selected', 'footer'); },
|
|
selectStylesheet: function() { this.set('selected', 'stylesheet'); },
|
|
selectMobileHeader: function() { this.set('selected', 'mobileHeader'); },
|
|
selectMobileFooter: function() { this.set('selected', 'mobileFooter'); },
|
|
selectMobileStylesheet: function() { this.set('selected', 'mobileStylesheet'); },
|
|
toggleMaximize: function() {
|
|
this.set("maximized", !this.get("maximized"));
|
|
|
|
Em.run.scheduleOnce('afterRender', this, function(){
|
|
$('.ace-wrapper').each(function(){
|
|
$(this).data("editor").resize();
|
|
});
|
|
});
|
|
|
|
},
|
|
},
|
|
|
|
didInsertElement: function() {
|
|
var controller = this.get('controller');
|
|
Mousetrap.bindGlobal('mod+s', function() {
|
|
controller.send("save");
|
|
return false;
|
|
});
|
|
},
|
|
|
|
willDestroyElement: function() {
|
|
Mousetrap.unbindGlobal('mod+s');
|
|
}
|
|
|
|
});
|