From c6e57d64d7f69cbe2a490c5c4f5915bf84c28ac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 15 Aug 2014 13:19:11 +0200 Subject: [PATCH] moved binding expression for panel width to directive --- src/app/controllers/row.js | 10 ++++++++++ src/app/partials/dashboard.html | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/controllers/row.js b/src/app/controllers/row.js index cbf04f890d8..387019afbab 100644 --- a/src/app/controllers/row.js +++ b/src/app/controllers/row.js @@ -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) + '%'; + }); + }; + }); + + + }); diff --git a/src/app/partials/dashboard.html b/src/app/partials/dashboard.html index 9fa279578ce..b506287eec7 100644 --- a/src/app/partials/dashboard.html +++ b/src/app/partials/dashboard.html @@ -101,8 +101,8 @@