This commit is contained in:
Mo Bitar
2020-02-08 20:37:07 -06:00
parent 8822580e7a
commit 5226d57623
7 changed files with 55 additions and 97 deletions

View File

@@ -5,12 +5,12 @@ class ActionsMenuCtrl extends PureCtrl {
/* @ngInject */
constructor(
$timeout,
actionsManager,
application,
godService
) {
super($timeout);
this.$timeout = $timeout;
this.actionsManager = actionsManager;
this.application = application;
this.godService = godService;
}
@@ -22,12 +22,12 @@ class ActionsMenuCtrl extends PureCtrl {
};
async loadExtensions() {
const extensions = this.actionsManager.extensions.sort((a, b) => {
const extensions = this.application.actionsManager.getExtensions().sort((a, b) => {
return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1;
});
for (const extension of extensions) {
extension.loading = true;
await this.actionsManager.loadExtensionInContextOfItem(extension, this.props.item);
await this.application.actionsManager.loadExtensionInContextOfItem(extension, this.props.item);
extension.loading = false;
}
this.setState({
@@ -45,7 +45,7 @@ class ActionsMenuCtrl extends PureCtrl {
return;
}
action.running = true;
const result = await this.actionsManager.executeAction(
const result = await this.application.actionsManager.executeAction(
action,
extension,
this.props.item
@@ -55,7 +55,7 @@ class ActionsMenuCtrl extends PureCtrl {
}
action.running = false;
this.handleActionResult(action, result);
await this.actionsManager.loadExtensionInContextOfItem(extension, this.props.item);
await this.application.actionsManager.loadExtensionInContextOfItem(extension, this.props.item);
this.setState({
extensions: this.state.extensions
});

View File

@@ -56,7 +56,7 @@ class ComponentViewCtrl {
identifier: this.themeHandlerIdentifier,
areas: ['themes'],
activationHandler: (component) => {
this.reloadThemeStatus();
}
});
@@ -130,7 +130,7 @@ class ComponentViewCtrl {
if(this.expired && doManualReload) {
this.$rootScope.$broadcast('reload-ext-dat');
}
this.reloadThemeStatus();
this.$timeout(() => {
this.reloading = false;
}, 500);
@@ -215,27 +215,8 @@ class ComponentViewCtrl {
}
}
reloadThemeStatus() {
if(this.component.acceptsThemes()) {
return;
}
if(this.themeManager.hasActiveTheme()) {
if(!this.dismissedNoThemesMessage) {
this.showNoThemesMessage = true;
}
} else {
this.showNoThemesMessage = false;
}
}
dismissNoThemesMessage() {
this.showNoThemesMessage = false;
this.dismissedNoThemesMessage = true;
}
disableActiveTheme() {
this.themeManager.deactivateAllThemes();
this.dismissNoThemesMessage();
}
getUrl() {