mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 01:41:46 +03:00
63b1e1d385
refs https://github.com/TryGhost/Team/issues/1111 refs https://github.com/TryGhost/Team/issues/1103 - moved customize modal from a link on the design screen to the main design screen - changed modal design to be a full-screen overlay with side bar that emulates standard Admin design - added toggled groups of settings in sidebar - added `{{set-has}}` helper for use in conditionals matching when a Set contains an object - added grouping of theme settings - dropped unfinished advanced/change theme modals
33 lines
849 B
JavaScript
33 lines
849 B
JavaScript
import Controller from '@ember/controller';
|
|
import {inject as service} from '@ember/service';
|
|
import {task} from 'ember-concurrency-decorators';
|
|
|
|
export default class SettingsDesignController extends Controller {
|
|
@service customThemeSettings;
|
|
@service notifications;
|
|
@service router;
|
|
@service settings;
|
|
|
|
@task
|
|
*saveTask() {
|
|
try {
|
|
if (this.settings.get('errors').length !== 0) {
|
|
return;
|
|
}
|
|
|
|
yield Promise.all([
|
|
this.settings.save(),
|
|
this.customThemeSettings.save()
|
|
]);
|
|
|
|
// ensure task button switches to success state
|
|
return true;
|
|
} catch (error) {
|
|
if (error) {
|
|
this.notifications.showAPIError(error);
|
|
throw error;
|
|
}
|
|
}
|
|
}
|
|
}
|