Commit 6e972332 by Torkel Ödegaard

Fixed issue span set to zero. Removed zero option from row editor. Closes #645

parent e9a046e7
...@@ -10,6 +10,10 @@ function (angular, _, $) { ...@@ -10,6 +10,10 @@ function (angular, _, $) {
// when changing arguments to this function // when changing arguments to this function
function PanelBaseCtrl($scope, $rootScope, $timeout) { function PanelBaseCtrl($scope, $rootScope, $timeout) {
if (!$scope.panel.span) {
$scope.panel.span = 12;
}
var menu = [ var menu = [
{ {
text: 'Edit', text: 'Edit',
...@@ -131,4 +135,4 @@ function (angular, _, $) { ...@@ -131,4 +135,4 @@ function (angular, _, $) {
return PanelBaseCtrl; return PanelBaseCtrl;
}); });
\ No newline at end of file
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
<div style="padding-top:0px" ng-if="!row.collapse"> <div style="padding-top:0px" ng-if="!row.collapse">
<!-- Panels --> <!-- Panels -->
<div ng-repeat="(name, panel) in row.panels|filter:isPanel" ng-hide="panel.hide" class="panel nospace" ng-style="{'width':!panel.span?'100%':(panel.span/1.2)*10+'%'}" data-drop="true" ng-model="row.panels" data-jqyoui-options jqyoui-droppable="{index:$index,mutate:false,onDrop:'panelMoveDrop',onOver:'panelMoveOver(true)',onOut:'panelMoveOut'}" ng-class="{'dragInProgress':dashboard.panelDragging}"> <div ng-repeat="(name, panel) in row.panels|filter:isPanel" ng-hide="panel.hide" class="panel nospace" ng-style="{'width':(panel.span/1.2)*10+'%'}" data-drop="true" ng-model="row.panels" data-jqyoui-options jqyoui-droppable="{index:$index,mutate:false,onDrop:'panelMoveDrop',onOver:'panelMoveOver(true)',onOut:'panelMoveOut'}" ng-class="{'dragInProgress':dashboard.panelDragging}">
<!-- Content Panel --> <!-- Content Panel -->
<div style="position:relative"> <div style="position:relative">
<grafana-panel type="panel.type" ng-cloak></grafana-panel> <grafana-panel type="panel.type" ng-cloak></grafana-panel>
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<tr ng-repeat="panel in row.panels"> <tr ng-repeat="panel in row.panels">
<td>{{panel.title}}</td> <td>{{panel.title}}</td>
<td>{{panel.type}}</td> <td>{{panel.type}}</td>
<td><select ng-hide="panel.sizeable == false" class="input-mini" ng-model="panel.span" ng-options="size for size in [0,1,2,3,4,5,6,7,8,9,10,11,12]"></select></td> <td><select ng-hide="panel.sizeable == false" class="input-mini" ng-model="panel.span" ng-options="size for size in [1,2,3,4,5,6,7,8,9,10,11,12]"></select></td>
<td><i ng-click="row.panels = _.without(row.panels,panel)" class="pointer icon-remove"></i></td> <td><i ng-click="row.panels = _.without(row.panels,panel)" class="pointer icon-remove"></i></td>
<td><i ng-click="_.move(row.panels,$index,$index-1)" ng-hide="$first" class="pointer icon-arrow-up"></i></td> <td><i ng-click="_.move(row.panels,$index,$index-1)" ng-hide="$first" class="pointer icon-arrow-up"></i></td>
<td><i ng-click="_.move(row.panels,$index,$index+1)" ng-hide="$last" class="pointer icon-arrow-down"></i></td> <td><i ng-click="_.move(row.panels,$index,$index+1)" ng-hide="$last" class="pointer icon-arrow-down"></i></td>
...@@ -63,4 +63,4 @@ ...@@ -63,4 +63,4 @@
<button ng-show="editor.index == 1" ng-click="editor.index = 2;" class="btn btn-success" ng-disabled="panel.loadingEditor">Add Panel</button> <button ng-show="editor.index == 1" ng-click="editor.index = 2;" class="btn btn-success" ng-disabled="panel.loadingEditor">Add Panel</button>
<button ng-show="panel.type && editor.index == 2" ng-click="add_panel(panel); reset_panel(); editor.index = 1;" class="btn btn-success" ng-disabled="panel.loadingEditor">Add Panel</button> <button ng-show="panel.type && editor.index == 2" ng-click="add_panel(panel); reset_panel(); editor.index = 1;" class="btn btn-success" ng-disabled="panel.loadingEditor">Add Panel</button>
<button type="button" class="btn btn-info" ng-click="editor.index=0;dismiss();reset_panel();close_edit()">Close</button> <button type="button" class="btn btn-info" ng-click="editor.index=0;dismiss();reset_panel();close_edit()">Close</button>
</div> </div>
\ No newline at end of file
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