Soft reload of component
This commit is contained in:
@@ -68,10 +68,7 @@ class ComponentView {
|
|||||||
|
|
||||||
$scope.reloadComponent = function() {
|
$scope.reloadComponent = function() {
|
||||||
console.log("Reloading component", $scope.component);
|
console.log("Reloading component", $scope.component);
|
||||||
componentManager.deactivateComponent($scope.component);
|
componentManager.reloadComponent($scope.component);
|
||||||
$timeout(() => {
|
|
||||||
componentManager.activateComponent($scope.component);
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.reloadStatus = function() {
|
$scope.reloadStatus = function() {
|
||||||
|
|||||||
@@ -762,6 +762,44 @@ class ComponentManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reloadComponent(component) {
|
||||||
|
//
|
||||||
|
// Do soft deactivate
|
||||||
|
//
|
||||||
|
component.active = false;
|
||||||
|
|
||||||
|
for(var handler of this.handlers) {
|
||||||
|
if(handler.areas.includes(component.area) || handler.areas.includes("*")) {
|
||||||
|
handler.activationHandler(component);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(component.area == "themes") {
|
||||||
|
this.postActiveThemeToAllComponents();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Do soft activate
|
||||||
|
//
|
||||||
|
|
||||||
|
this.timeout(() => {
|
||||||
|
component.active = true;
|
||||||
|
for(var handler of this.handlers) {
|
||||||
|
if(handler.areas.includes(component.area) || handler.areas.includes("*")) {
|
||||||
|
handler.activationHandler(component);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!this.activeComponents.includes(component)) {
|
||||||
|
this.activeComponents.push(component);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(component.area == "themes") {
|
||||||
|
this.postActiveThemeToAllComponents();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
deleteComponent(component) {
|
deleteComponent(component) {
|
||||||
this.modelManager.setItemToBeDeleted(component);
|
this.modelManager.setItemToBeDeleted(component);
|
||||||
this.syncManager.sync("deleteComponent");
|
this.syncManager.sync("deleteComponent");
|
||||||
|
|||||||
Reference in New Issue
Block a user