diff options
author | Andreas Berenz | 2016-09-06 10:16:25 +0200 |
---|---|---|
committer | Andreas Berenz | 2016-09-06 10:16:25 +0200 |
commit | a020e17f6e1b4049c468731523f52ec5b51e33d9 (patch) | |
tree | 30505d0941d1c49af57645f9618b9fb80d5778da /modules-available/roomplanner/js/grid.js | |
parent | Merge branch 'modularization' of git.openslx.org:openslx-ng/slx-admin into mo... (diff) | |
download | slx-admin-a020e17f6e1b4049c468731523f52ec5b51e33d9.tar.gz slx-admin-a020e17f6e1b4049c468731523f52ec5b51e33d9.tar.xz slx-admin-a020e17f6e1b4049c468731523f52ec5b51e33d9.zip |
scaling orientation now is viewport-center instead of top left position - magnifier are clickable for scaling
Diffstat (limited to 'modules-available/roomplanner/js/grid.js')
-rw-r--r-- | modules-available/roomplanner/js/grid.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modules-available/roomplanner/js/grid.js b/modules-available/roomplanner/js/grid.js index 44f32123..9fdd99e4 100644 --- a/modules-available/roomplanner/js/grid.js +++ b/modules-available/roomplanner/js/grid.js @@ -353,6 +353,18 @@ roomplanner.grid = (function() { $('#drawarea').height(h); }, scale: function(num) { + + var area_left = parseInt($('#drawarea').css('left')) - $('#drawpanel .panel-body').width()/2 ; + var area_top = parseInt($('#drawarea').css('top')) - $('#drawpanel .panel-body').height()/2; + + var opts = { + left: ((parseInt(area_left) * num / roomplanner.settings.scale ) + $('#drawpanel .panel-body').width()/2)+ "px" , + top: ((parseInt(area_top) * num / roomplanner.settings.scale ) + $('#drawpanel .panel-body').height()/2)+ "px" + }; + + $('#drawarea').css(opts); + + $('#drawarea').css('background-size',num); roomplanner.settings.scale = num; $('#draw-element-area .ui-draggable').each(function(idx,item) { @@ -434,6 +446,10 @@ $(document).ready(function(){ // the element is already in drawing area var el = (ui.helper == ui.draggable) ? ui.draggable : $(ui.helper.clone()); if ($(el).collision('[itemtype="'+$(el).attr('itemtype').replace('_drag','')+'"]').length) { + + // pathfinding zu besserer position + + return; } |