Browse Source

made a keyboard shortcut to duplicate panel

Patrick O'Carroll 7 years ago
parent
commit
1094dc32bc
1 changed files with 8 additions and 0 deletions
  1. 8 0
      public/app/core/services/keybindingSrv.ts

+ 8 - 0
public/app/core/services/keybindingSrv.ts

@@ -178,6 +178,14 @@ export class KeybindingSrv {
       }
     });
 
+    // duplicate panel
+    this.bind('p d', () => {
+      if (dashboard.meta.focusPanelId && dashboard.meta.canEdit) {
+        let panelIndex = dashboard.getPanelInfoById(dashboard.meta.focusPanelId).index;
+        dashboard.duplicatePanel(dashboard.panels[panelIndex]);
+      }
+    });
+
     // share panel
     this.bind('p s', () => {
       if (dashboard.meta.focusPanelId) {