Commit 4db723ea by Torkel Ödegaard

ux(panel resize): snap to even 12ths spans

parent 10a42cc9
......@@ -159,19 +159,28 @@ module.directive('panelResizer', function($rootScope) {
}
scope.$apply(function() {
ctrl.render();
// ctrl.render();
});
}
function dragEndHandler() {
ctrl.panel.span = Math.round(ctrl.panel.span);
if (lastPanel) {
lastPanel.span = Math.round(lastPanel.span);
}
// if close to 12
var rowSpan = ctrl.dashboard.rowSpan(ctrl.row);
if (rowSpan < 12 && rowSpan > 11) {
lastPanel.span += 12 - rowSpan;
}
scope.$apply(function() {
$rootScope.$broadcast('render');
// first digest to propagate panel width change
// then render
$rootScope.$apply(function() {
setTimeout(function() {
$rootScope.$broadcast('render');
});
});
$('body').off('mousemove', moveHandler);
......
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