From cd087df95dce695f044472b6f017fbb697e90b7f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Mon, 27 Jan 2014 12:55:46 +0100 Subject: [PATCH 1/1] editor: fixing grid to handle changes to the document when grid is turned on Previously new nodes didn't get their border during grid being toggled. --- src/editor/modules/documentCanvas/commands.js | 2 +- src/editor/modules/documentCanvas/nodes.less | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/editor/modules/documentCanvas/commands.js b/src/editor/modules/documentCanvas/commands.js index 284c613..e0fc3f8 100644 --- a/src/editor/modules/documentCanvas/commands.js +++ b/src/editor/modules/documentCanvas/commands.js @@ -97,7 +97,7 @@ commands.register('list', function(canvas, params) { }); commands.register('toggle-grid', function(canvas, params) { - canvas.doc().dom().find('[wlxml-tag]').toggleClass('rng-common-hoveredNode', params.toggle); + canvas.doc().dom().parent().toggleClass('grid-on', params.toggle); gridToggled = params.toggle; }); diff --git a/src/editor/modules/documentCanvas/nodes.less b/src/editor/modules/documentCanvas/nodes.less index 367e4aa..c48ca0d 100644 --- a/src/editor/modules/documentCanvas/nodes.less +++ b/src/editor/modules/documentCanvas/nodes.less @@ -17,6 +17,12 @@ padding: 1px 1px; } +.grid-on { + [wlxml-tag] { + .rng-common-hoveredNode; + } +} + [wlxml-tag=span] { min-width: 10px; } -- 2.20.1