editor: fixing grid to handle changes to the document when grid is turned on
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 27 Jan 2014 11:55:46 +0000 (12:55 +0100)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 27 Jan 2014 11:55:46 +0000 (12:55 +0100)
Previously new nodes didn't get their border during grid being toggled.

src/editor/modules/documentCanvas/commands.js
src/editor/modules/documentCanvas/nodes.less

index 284c613..e0fc3f8 100644 (file)
@@ -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;
 });
 
index 367e4aa..c48ca0d 100644 (file)
     padding: 1px 1px;
 }
 
+.grid-on {
+    [wlxml-tag] {
+        .rng-common-hoveredNode;
+    }
+}
+
 [wlxml-tag=span] {
     min-width: 10px;
 }