DEV: Code style improvements following review

DEV: Code style improvements following review

Followup to 05ee1d1aba3d1238867b59d91b72327688358439

diff --git a/app/assets/javascripts/admin/components/admin-theme-editor.js.es6 b/app/assets/javascripts/admin/components/admin-theme-editor.js.es6
index af661e4..c9d4c80 100644
--- a/app/assets/javascripts/admin/components/admin-theme-editor.js.es6
+++ b/app/assets/javascripts/admin/components/admin-theme-editor.js.es6
@@ -1,4 +1,5 @@
 import { default as computed } from "ember-addons/ember-computed-decorators";
+import { fmt } from "discourse/lib/computed";
 
 export default Ember.Component.extend({
   @computed("theme.targets", "onlyOverridden", "showAdvanced")
@@ -40,10 +41,7 @@ export default Ember.Component.extend({
     }
   },
 
-  @computed("fieldName", "currentTargetName")
-  editorId(fieldName, currentTarget) {
-    return fieldName + "|" + currentTarget;
-  },
+  editorId: fmt("fieldName", "currentTargetName", "%@|%@"),
 
   @computed("maximized")
   maximizeIcon(maximized) {
@@ -77,16 +75,13 @@ export default Ember.Component.extend({
       if (!name) return;
       name = name.replace(/\W/g, "");
       this.get("theme").setField(this.get("currentTargetName"), name, "");
-      this.set("newFieldName", "");
-      this.set("addingField", false);
+      this.setProperties({ newFieldName: "", addingField: false });
       this.fieldAdded(this.get("currentTargetName"), name);
     },
 
     toggleMaximize: function() {
       this.toggleProperty("maximized");
-      Ember.run.next(() => {
-        this.appEvents.trigger("ace:resize");
-      });
+      Ember.run.next(() => this.appEvents.trigger("ace:resize"));
     },
 
     onlyOverriddenChanged(value) {
diff --git a/app/assets/javascripts/admin/models/theme.js.es6 b/app/assets/javascripts/admin/models/theme.js.es6
index 25612ed..7b2706d 100644
--- a/app/assets/javascripts/admin/models/theme.js.es6
+++ b/app/assets/javascripts/admin/models/theme.js.es6
@@ -154,9 +154,7 @@ const Theme = RestModel.extend({
 
   hasError(target, name) {
     return this.get("theme_fields")
-      .filter(f => {
-        return f.target === target && (!name || name === f.name);
-      })
+      .filter(f => f.target === target && (!name || name === f.name))
       .any(f => f.error);
   },
 
diff --git a/app/assets/javascripts/admin/templates/components/admin-theme-editor.hbs b/app/assets/javascripts/admin/templates/components/admin-theme-editor.hbs
index 029fd20..31cd134 100644
--- a/app/assets/javascripts/admin/templates/components/admin-theme-editor.hbs
+++ b/app/assets/javascripts/admin/templates/components/admin-theme-editor.hbs
@@ -4,12 +4,12 @@
         {{#each visibleTargets as |target|}}
         <li>
             {{#link-to editRouteName
-            theme.id 
-            target.name 
-            fieldName 
-            replace=true 
-            title=field.title 
-            class=(if target.edited 'edited' 'blank')
+                theme.id 
+                target.name 
+                fieldName 
+                replace=true 
+                title=field.title 
+                class=(if target.edited 'edited' 'blank')
             }}
             {{#if target.error}}{{d-icon 'exclamation-triangle'}}{{/if}}
             {{#if target.icon}}
@@ -24,11 +24,7 @@
             class='no-text' 
             title="{{i18n (concat "admin.customize.theme." (if showAdvanced "hide_advanced" "show_advanced"))}}"
         >
-            {{#if showAdvanced}}
-            {{d-icon "angle-double-left"}}
-            {{else}}
-            {{d-icon "angle-double-right"}}
-            {{/if}}
+            {{d-icon (if showAdvanced "angle-double-left" "angle-double-right")}}   
         </a>
         </li>
         <li class="spacer"></li>

GitHub sha: dbcf05d6

1 Like