moved binding expression for panel width to directive

This commit is contained in:
Torkel Ödegaard 2014-08-15 13:19:11 +02:00
parent dc3cd430c8
commit c6e57d64d7
2 changed files with 11 additions and 1 deletions

View File

@ -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) + '%';
});
};
});
});

View File

@ -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'}"