|
@@ -44,8 +44,8 @@ const panelTemplate = `
|
|
|
</li>
|
|
</li>
|
|
|
</ul>
|
|
</ul>
|
|
|
|
|
|
|
|
- <button class="panel-editor-tabs__close" ng-click="ctrl.exitFullscreen();">
|
|
|
|
|
- <i class="fa fa-reply"></i>
|
|
|
|
|
|
|
+ <button class="tabbed-view-close-btn" ng-click="ctrl.exitFullscreen();">
|
|
|
|
|
+ <i class="fa fa-remove"></i>
|
|
|
</button>
|
|
</button>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -80,6 +80,16 @@ module.directive('grafanaPanel', ($rootScope, $document, $timeout) => {
|
|
|
let lastAlertState;
|
|
let lastAlertState;
|
|
|
let hasAlertRule;
|
|
let hasAlertRule;
|
|
|
|
|
|
|
|
|
|
+ function mouseEnter() {
|
|
|
|
|
+ panelContainer.toggleClass('panel-hover-highlight', true);
|
|
|
|
|
+ ctrl.dashboard.setPanelFocus(ctrl.panel.id);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function mouseLeave() {
|
|
|
|
|
+ panelContainer.toggleClass('panel-hover-highlight', false);
|
|
|
|
|
+ ctrl.dashboard.setPanelFocus(0);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
function resizeScrollableContent() {
|
|
function resizeScrollableContent() {
|
|
|
if (panelScrollbar) {
|
|
if (panelScrollbar) {
|
|
|
panelScrollbar.update();
|
|
panelScrollbar.update();
|
|
@@ -130,6 +140,19 @@ module.directive('grafanaPanel', ($rootScope, $document, $timeout) => {
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ ctrl.events.on('view-mode-changed', () => {
|
|
|
|
|
+ // first wait one pass for dashboard fullscreen view mode to take effect (classses being applied)
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ // then recalc style
|
|
|
|
|
+ ctrl.calculatePanelHeight();
|
|
|
|
|
+ // then wait another cycle (this might not be needed)
|
|
|
|
|
+ $timeout(() => {
|
|
|
|
|
+ ctrl.render();
|
|
|
|
|
+ resizeScrollableContent();
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
// set initial height
|
|
// set initial height
|
|
|
ctrl.calculatePanelHeight();
|
|
ctrl.calculatePanelHeight();
|
|
|
|
|
|
|
@@ -151,7 +174,11 @@ module.directive('grafanaPanel', ($rootScope, $document, $timeout) => {
|
|
|
panelContainer.removeClass('panel-alert-state--' + lastAlertState);
|
|
panelContainer.removeClass('panel-alert-state--' + lastAlertState);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (ctrl.alertState.state === 'ok' || ctrl.alertState.state === 'alerting') {
|
|
|
|
|
|
|
+ if (
|
|
|
|
|
+ ctrl.alertState.state === 'ok' ||
|
|
|
|
|
+ ctrl.alertState.state === 'alerting' ||
|
|
|
|
|
+ ctrl.alertState.state === 'pending'
|
|
|
|
|
+ ) {
|
|
|
panelContainer.addClass('panel-alert-state--' + ctrl.alertState.state);
|
|
panelContainer.addClass('panel-alert-state--' + ctrl.alertState.state);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -202,6 +229,9 @@ module.directive('grafanaPanel', ($rootScope, $document, $timeout) => {
|
|
|
scope.$apply(ctrl.openInspector.bind(ctrl));
|
|
scope.$apply(ctrl.openInspector.bind(ctrl));
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ elem.on('mouseenter', mouseEnter);
|
|
|
|
|
+ elem.on('mouseleave', mouseLeave);
|
|
|
|
|
+
|
|
|
scope.$on('$destroy', () => {
|
|
scope.$on('$destroy', () => {
|
|
|
elem.off();
|
|
elem.off();
|
|
|
cornerInfoElem.off();
|
|
cornerInfoElem.off();
|