mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
moved binding expression for panel width to directive
This commit is contained in:
parent
dc3cd430c8
commit
c6e57d64d7
@ -116,4 +116,14 @@ function (angular, app, _) {
|
||||
};
|
||||
});
|
||||
|
||||
module.directive('panelWidth', function() {
|
||||
return function(scope, element) {
|
||||
scope.$watch('panel.span', function() {
|
||||
element[0].style.width = ((scope.panel.span / 1.2) * 10) + '%';
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
@ -101,8 +101,8 @@
|
||||
<div ng-repeat="(name, panel) in row.panels"
|
||||
class="panel nospace"
|
||||
style="position:relative"
|
||||
ng-style="{'width':(panel.span/1.2)*10+'%'}"
|
||||
data-drop="true"
|
||||
panel-width
|
||||
ng-model="panel"
|
||||
data-jqyoui-options
|
||||
jqyoui-droppable="{index:$index,mutate:false,onDrop:'panelMoveDrop',onOver:'panelMoveOver(true)',onOut:'panelMoveOut'}"
|
||||
|
Loading…
Reference in New Issue
Block a user