diff --git a/public/app/core/components/row_ctrl.ts b/public/app/core/components/row_ctrl.ts index 549b0b148ab..7e05c1d34a7 100644 --- a/public/app/core/components/row_ctrl.ts +++ b/public/app/core/components/row_ctrl.ts @@ -5,13 +5,18 @@ import _ from 'lodash'; export class DashboardRowCtrl { static template = ` + + + + {{ctrl.panel.title | interpolateTemplateVars:this}} +
+ drag +
-
-
`; dashboard: any; diff --git a/public/app/features/dashboard/dashgrid/dashgrid.ts b/public/app/features/dashboard/dashgrid/dashgrid.ts index a948006f724..9a6df7cadb0 100644 --- a/public/app/features/dashboard/dashgrid/dashgrid.ts +++ b/public/app/features/dashboard/dashgrid/dashgrid.ts @@ -47,7 +47,7 @@ export class GridCtrl { cellHeight: CELL_HEIGHT, verticalMargin: CELL_VMARGIN, acceptWidgets: '.grid-stack-item', - handle: '.panel-header' + handle: '.grid-drag-handle' }).data('gridstack'); this.isInitialized = true; @@ -104,6 +104,23 @@ export class GridCtrl { return 0; }); + let lastPanel = null; + for (let panel of this.dashboard.panels) { + if (lastPanel && lastPanel.type === 'row' && panel.type === 'row') { + if (panel.hiddenPanels.length === 0) { + continue; + } + + for (let item of items) { + if (panel.id === parseInt(item.id)) { + this.gridstack.move(item.el, item.x, item.y-1, item.width, item.height, false); + } + } + } + + lastPanel = panel; + } + this.$scope.$broadcast('render'); } @@ -156,6 +173,7 @@ export function dashGridItem($timeout, $rootScope) { 'data-gs-y': panel.y, 'data-gs-width': panel.width, 'data-gs-height': panel.height, + 'data-gs-no-resize': panel.type === 'row', }); $rootScope.onAppEvent('panel-fullscreen-exit', (evt, payload) => { diff --git a/public/app/features/panel/panel_directive.ts b/public/app/features/panel/panel_directive.ts index 83fb32a34c6..4369aaff74e 100644 --- a/public/app/features/panel/panel_directive.ts +++ b/public/app/features/panel/panel_directive.ts @@ -10,7 +10,7 @@ var module = angular.module('grafana.directives'); var panelTemplate = `
-
+
diff --git a/public/sass/components/_row.scss b/public/sass/components/_row.scss index ca30573eed6..61a92acb37d 100644 --- a/public/sass/components/_row.scss +++ b/public/sass/components/_row.scss @@ -3,6 +3,7 @@ display: flex; height: 30px; align-items: center; + padding: 0 0.5rem; &--collapse { background: $panel-bg; @@ -11,7 +12,6 @@ } &:hover { - background: $panel-bg; .dashboard-row__chevron { color: $link-color; } @@ -28,27 +28,24 @@ flex-direction: row; margin-right: $panel-margin; margin-left: 0; - font-size: $font-size-lg; + font-size: 1.15rem; font-weight: $font-weight-semi-bold; - //text-align: center; - display: block; } .dashboard-row__chevron { - padding: 0 2px; font-size: $font-size-xs; color: $text-muted; position: relative; - left: -3px; - top: -1px; + top: 6px; } .dashboard-row__settings { display: none; + color: $text-color-weak; } .dashboard-row__title-text { - padding-left: 0.6rem; + padding-left: 0.4rem; color: $text-color; } diff --git a/tasks/options/watch.js b/tasks/options/watch.js index 082f97fec77..6b47494f9ce 100644 --- a/tasks/options/watch.js +++ b/tasks/options/watch.js @@ -25,6 +25,7 @@ module.exports = function(config, grunt) { config.srcDir + '/sass/**/*', config.srcDir + '/app/**/*', config.srcDir + '/test/**/*', + config.srcDir + '/vendor/npm/gridstack/dist/*.js', config.srcDir + '/vendor/npm/gemini-scrollbar/*.js', ], function(err, watcher) {