From: Aleksander Ɓukasz Date: Mon, 27 Jan 2014 11:55:46 +0000 (+0100) Subject: editor: fixing grid to handle changes to the document when grid is turned on X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/cd087df95dce695f044472b6f017fbb697e90b7f?ds=inline 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. --- 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; }