From 1b1109b59a8e4d64aab2f8494e9df051a2028044 Mon Sep 17 00:00:00 2001 From: timb Date: Wed, 10 Jun 2015 03:05:41 -0400 Subject: reposition selection if grid control is toggled --- js/ui/controls.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'js/ui/controls.js') diff --git a/js/ui/controls.js b/js/ui/controls.js index 4a576e5..0665747 100644 --- a/js/ui/controls.js +++ b/js/ui/controls.js @@ -106,14 +106,17 @@ var controls = (function(){ controls.grid = new BlurredCheckbox (grid_el) controls.grid.use = function(){ document.body.classList.toggle('grid') + if (!selection.hidden) selection.reposition() this.update( document.body.classList.contains("grid") ) } controls.grid.show = function(){ document.body.classList.add('grid') + if (!selection.hidden) selection.reposition() this.update( true ) } controls.grid.hide = function(){ document.body.classList.remove('grid') + if (!selection.hidden) selection.reposition() this.update( false ) } @@ -258,4 +261,4 @@ var controls = (function(){ } return controls -})() \ No newline at end of file +})() -- cgit v1.2.3-70-g09d2