feedback (see commit description for details)

* fill blank space when no theme is selected
* animate row's height in themes/components list when selecting, and hide children list
* show warning when you move to a different page and have unsaved changes
* refactor `adminCustomizeThemes.show` controller
* allow collapsing/expanding children lists
* fix a bug when adding components to a theme (changed the way it works slightly)
* a bunch of other minor things
This commit is contained in:
OsamaSayegh
2018-09-06 21:56:00 +03:00
committed by Sam
parent a4f057a589
commit ca28548762
15 changed files with 372 additions and 208 deletions

View File

@ -5,8 +5,10 @@ import {
} from "ember-addons/ember-computed-decorators";
export default Ember.Controller.extend({
maximized: false,
section: null,
currentTarget: 0,
maximized: false,
previewUrl: url("model.id", "/admin/themes/%@/preview"),
editRouteName: "adminCustomizeThemes.edit",
@ -86,8 +88,6 @@ export default Ember.Controller.extend({
return this.get("model").hasEdited(target);
},
currentTarget: 0,
setTargetName: function(name) {
const target = this.get("targets").find(t => t.name === name);
this.set("currentTarget", target && target.id);
@ -152,21 +152,20 @@ export default Ember.Controller.extend({
});
},
previewUrl: url("model.id", "/admin/themes/%@/preview"),
@computed("maximized")
maximizeIcon(maximized) {
return maximized ? "compress" : "expand";
},
maximizeIcon: function() {
return this.get("maximized") ? "compress" : "expand";
}.property("maximized"),
@computed("model.isSaving")
saveButtonText(isSaving) {
return isSaving ? I18n.t("saving") : I18n.t("admin.customize.save");
},
saveButtonText: function() {
return this.get("model.isSaving")
? I18n.t("saving")
: I18n.t("admin.customize.save");
}.property("model.isSaving"),
saveDisabled: function() {
return !this.get("model.changed") || this.get("model.isSaving");
}.property("model.changed", "model.isSaving"),
@computed("model.changed", "model.isSaving")
saveDisabled(changed, isSaving) {
return !changed || isSaving;
},
actions: {
save() {