@@ -14,19 +14,17 @@ Discourse.SiteCustomization = Discourse.Model.extend({
1414 return this . startTrackingChanges ( ) ;
1515 } ,
1616
17- description : ( function ( ) {
17+ description : function ( ) {
1818 return "" + this . name + ( this . enabled ? ' (*)' : '' ) ;
19- } ) . property ( 'selected' , 'name' ) ,
19+ } . property ( 'selected' , 'name' ) ,
2020
21- changed : ( function ( ) {
21+ changed : function ( ) {
2222 var _this = this ;
23- if ( ! this . originals ) {
24- return false ;
25- }
23+ if ( ! this . originals ) return false ;
2624 return this . trackedProperties . any ( function ( p ) {
2725 return _this . originals [ p ] !== _this . get ( p ) ;
2826 } ) ;
29- } ) . property ( 'override_default_style' , 'enabled' , 'name' , 'stylesheet' , 'header' , 'originals' ) ,
27+ } . property ( 'override_default_style' , 'enabled' , 'name' , 'stylesheet' , 'header' , 'originals' ) ,
3028
3129 startTrackingChanges : function ( ) {
3230 var _this = this ;
@@ -37,18 +35,17 @@ Discourse.SiteCustomization = Discourse.Model.extend({
3735 } ) ;
3836 } ,
3937
40- previewUrl : ( function ( ) {
38+ previewUrl : function ( ) {
4139 return "/?preview-style=" + ( this . get ( 'key' ) ) ;
42- } ) . property ( 'key' ) ,
40+ } . property ( 'key' ) ,
4341
44- disableSave : ( function ( ) {
42+ disableSave : function ( ) {
4543 return ! this . get ( 'changed' ) ;
46- } ) . property ( 'changed' ) ,
44+ } . property ( 'changed' ) ,
4745
4846 save : function ( ) {
49- var data ;
5047 this . startTrackingChanges ( ) ;
51- data = {
48+ var data = {
5249 name : this . name ,
5350 enabled : this . enabled ,
5451 stylesheet : this . stylesheet ,
@@ -66,7 +63,6 @@ Discourse.SiteCustomization = Discourse.Model.extend({
6663
6764 destroy : function ( ) {
6865 if ( ! this . id ) return ;
69-
7066 return Discourse . ajax ( {
7167 url : Discourse . getURL ( "/admin/site_customizations/" ) + this . id ,
7268 type : 'DELETE'
@@ -76,13 +72,12 @@ Discourse.SiteCustomization = Discourse.Model.extend({
7672} ) ;
7773
7874var SiteCustomizations = Ember . ArrayProxy . extend ( {
79- selectedItemChanged : ( function ( ) {
80- var selected ;
81- selected = this . get ( 'selectedItem' ) ;
75+ selectedItemChanged : function ( ) {
76+ var selected = this . get ( 'selectedItem' ) ;
8277 return this . get ( 'content' ) . each ( function ( i ) {
8378 return i . set ( 'selected' , selected === i ) ;
8479 } ) ;
85- } ) . observes ( 'selectedItem' )
80+ } . observes ( 'selectedItem' )
8681} ) ;
8782
8883Discourse . SiteCustomization . reopenClass ( {
0 commit comments