tweaks to new panel menu, now how top area of panel is clickable, and if no title a 5px high area can be clicked, this will enable panels without title which is something I have wanted

This commit is contained in:
Torkel Ödegaard 2014-09-24 12:41:17 +02:00
parent b9604bf3bc
commit a08cb52ad9
4 changed files with 8 additions and 6 deletions

View File

@ -26,7 +26,7 @@ function (angular, $) {
'<i class="icon-spinner icon-spin icon-large"></i>' + '<i class="icon-spinner icon-spin icon-large"></i>' +
'</span>' + '</span>' +
'<div panel-menu></div>' + '<div class="panel-title-container" panel-menu></div>' +
'</div>'+ '</div>'+
'</div>'; '</div>';

View File

@ -9,7 +9,7 @@ function (angular, $, _) {
angular angular
.module('grafana.directives') .module('grafana.directives')
.directive('panelMenu', function($compile) { .directive('panelMenu', function($compile) {
var linkTemplate = '<a class="pointer panel-title">{{panel.title || interpolateTemplateVars}}</a>'; var linkTemplate = '<a class="panel-title">{{panel.title || interpolateTemplateVars}}</a>';
var moveAttributes = ' data-drag=true data-jqyoui-options="kbnJqUiDraggableOptions"'+ var moveAttributes = ' data-drag=true data-jqyoui-options="kbnJqUiDraggableOptions"'+
' jqyoui-draggable="{'+ ' jqyoui-draggable="{'+
'animate:false,'+ 'animate:false,'+
@ -62,8 +62,6 @@ function (angular, $, _) {
clearTimeout(timeout); clearTimeout(timeout);
timeout = null; timeout = null;
console.log('dismiss', time);
if (time) { if (time) {
timeout = setTimeout(dismiss, time); timeout = setTimeout(dismiss, time);
return; return;
@ -124,7 +122,7 @@ function (angular, $, _) {
dismiss(2500); dismiss(2500);
}; };
$link.click(showMenu); elem.click(showMenu);
$compile(elem.contents())($scope); $compile(elem.contents())($scope);
} }
}; };

View File

@ -10,7 +10,6 @@ function (angular, _) {
this.init = function($scope) { this.init = function($scope) {
if (!$scope.panel.span) { $scope.panel.span = 12; } if (!$scope.panel.span) { $scope.panel.span = 12; }
if (!$scope.panel.title) { $scope.panel.title = 'No title'; }
var menu = [ var menu = [
{ {

View File

@ -15,6 +15,11 @@
padding: 0px 10px 5px 10px; padding: 0px 10px 5px 10px;
} }
.panel-title-container {
min-height: 5px;
cursor: pointer;
}
.panel-title { .panel-title {
border: 0px; border: 0px;
font-weight: bold; font-weight: bold;