瀏覽代碼

feat(panels): adds queryparameter for choose active tab in edit mode

bergquist 9 年之前
父節點
當前提交
2b06ceda71
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      public/app/features/panel/panel_ctrl.ts

+ 9 - 0
public/app/features/panel/panel_ctrl.ts

@@ -90,6 +90,15 @@ export class PanelCtrl {
     this.addEditorTab('General', 'public/app/partials/panelgeneral.html');
     this.editModeInitiated = true;
     this.events.emit('init-edit-mode', null);
+
+    var route = this.$injector.get('$route');
+    if (route.current.params.editorTab) {
+      this.editorTabs.forEach((tab, i) => {
+        if (tab.title === route.current.params.editorTab) {
+          this.editorTabIndex = i;
+        }
+      });
+    }
   }
 
   addEditorTab(title, directiveFn, index?) {