Commit 1742c03b by Torkel Ödegaard

small refactoring

parent 00777ea1
......@@ -7,11 +7,21 @@ function (angular) {
angular
.module('kibana.directives')
.directive('kibanaPanel', function($compile) {
var container = '<div class="panelCont"></div>';
var editorTemplate =
var container = '<div class="panel-container"></div>';
var content = '<div class="panel-content"></div>';
'<div class="row-fluid panel-extra"><div class="panel-extra-container">' +
var panelHeader =
'<div class="panel-header">'+
'<div class="row-fluid">' +
'<div class="span12 alert-error panel-error" ng-hide="!panel.error">' +
'<a class="close" ng-click="panel.error=false">&times;</a>' +
'<i class="icon-exclamation-sign"></i> <strong>Oops!</strong> {{panel.error}}' +
'</div>' +
'</div>\n' +
'<div class="row-fluid panel-extra">' +
'<div class="panel-extra-container">' +
'<span class="row-button extra" ng-show="panelMeta.loading == true">' +
'<span>'+
......@@ -39,7 +49,10 @@ function (angular) {
'{{panel.title}}' +
'</span>'+
'</div></div>';
'</div>'+
'</div>\n'+
'</div>';
return {
restrict: 'E',
link: function($scope, elem, attr) {
......@@ -77,7 +90,9 @@ function (angular) {
$controllers = $controllers.add($module.find('ngcontroller, [ng-controller], .ng-controller'));
if ($controllers.length) {
$controllers.first().prepend(editorTemplate);
$controllers.first().prepend(panelHeader);
$controllers.first().find('.panel-header').nextAll().wrapAll(content);
$scope.require([
'panels/'+nameAsPath+'/module'
], function() {
......
......@@ -47,14 +47,6 @@
<!-- Panels -->
<div ng-repeat="(name, panel) in row.panels|filter:isPanel" ng-hide="panel.span == 0 || panel.hide" class="span{{panel.span}} panel nospace" style="min-height:{{row.height}}; position:relative" data-drop="true" ng-model="row.panels" data-jqyoui-options jqyoui-droppable="{index:$index,mutate:false,onDrop:'panelMoveDrop',onOver:'panelMoveOver(true)',onOut:'panelMoveOut'}">
<!-- Error Panel -->
<div class="row-fluid">
<div class="span12 alert-error panel-error" ng-hide="!panel.error">
<a class="close" ng-click="panel.error=false">&times;</a>
<i class="icon-exclamation-sign"></i> <strong>Oops!</strong> {{panel.error}}
</div>
</div>
<!-- Content Panel -->
<div class="row-fluid" style="position:relative" ng-class="{'dragInProgress':dashboard.panelDragging}" >
<kibana-panel type="panel.type" ng-cloak></kibana-panel>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -51,12 +51,19 @@ code, pre {
background-color: @grayLighter;
}
.panelCont {
padding: 0px 10px 10px 10px;
.panel-container {
padding: 0px 0px 0px 0px;
background: @kibanaPanelBackground;
margin: 0px;
//border: 1px solid rgba(100, 100, 100, 0.25);
//outline: 1px solid darken(@bodyBackground, 10%);
}
.panel-content {
padding: 0px 10px 10px 10px;
}
.panel-title {
border: 0px;
font-weight: bold;
}
div.editor-row {
......@@ -231,12 +238,6 @@ form input.ng-invalid {
z-index: 9999;
}
.panel-title {
border: 0px;
//text-transform: uppercase;
font-weight: bold;
}
.panel div.panel-extra div.panel-extra-container {
margin-right: -10px;
margin-top: 3px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment