|
@@ -18,7 +18,6 @@ export class PanelCtrl {
|
|
|
panel: any;
|
|
panel: any;
|
|
|
error: any;
|
|
error: any;
|
|
|
dashboard: any;
|
|
dashboard: any;
|
|
|
- editorTabIndex: number;
|
|
|
|
|
pluginName: string;
|
|
pluginName: string;
|
|
|
pluginId: string;
|
|
pluginId: string;
|
|
|
editorTabs: any;
|
|
editorTabs: any;
|
|
@@ -39,7 +38,7 @@ export class PanelCtrl {
|
|
|
this.$location = $injector.get('$location');
|
|
this.$location = $injector.get('$location');
|
|
|
this.$scope = $scope;
|
|
this.$scope = $scope;
|
|
|
this.$timeout = $injector.get('$timeout');
|
|
this.$timeout = $injector.get('$timeout');
|
|
|
- this.editorTabIndex = 0;
|
|
|
|
|
|
|
+ this.editorTabs = [];
|
|
|
this.events = this.panel.events;
|
|
this.events = this.panel.events;
|
|
|
this.timing = {};
|
|
this.timing = {};
|
|
|
|
|
|
|
@@ -90,10 +89,10 @@ export class PanelCtrl {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
initEditMode() {
|
|
initEditMode() {
|
|
|
- this.editorTabs = [];
|
|
|
|
|
-
|
|
|
|
|
- this.editModeInitiated = true;
|
|
|
|
|
- this.events.emit('init-edit-mode', null);
|
|
|
|
|
|
|
+ if (!this.editModeInitiated) {
|
|
|
|
|
+ this.editModeInitiated = true;
|
|
|
|
|
+ this.events.emit('init-edit-mode', null);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
addEditorTab(title, directiveFn, index?, icon?) {
|
|
addEditorTab(title, directiveFn, index?, icon?) {
|
|
@@ -212,11 +211,6 @@ export class PanelCtrl {
|
|
|
this.containerHeight = $(window).height();
|
|
this.containerHeight = $(window).height();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // hacky solution
|
|
|
|
|
- if (this.panel.isEditing && !this.editModeInitiated) {
|
|
|
|
|
- this.initEditMode();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
this.height = this.containerHeight - (PANEL_BORDER + PANEL_HEADER_HEIGHT);
|
|
this.height = this.containerHeight - (PANEL_BORDER + PANEL_HEADER_HEIGHT);
|
|
|
}
|
|
}
|
|
|
|
|
|