Allow for wrapping current node element when there is no selection
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Fri, 9 Aug 2013 12:22:59 +0000 (14:22 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Fri, 9 Aug 2013 12:22:59 +0000 (14:22 +0200)
modules/documentCanvas/commands.js

index 738ab76..955ba48 100644 (file)
@@ -107,6 +107,9 @@ commands.register('newNodeRequested', function(canvas, params) {
                 });
             }
         }
                 });
             }
         }
+    } else if(canvas.getCurrentNodeElement()) {
+        var el = canvas.getCurrentNodeElement().wrapWithNodeElement({tag: params.wlxmlTag, klass: params.wlxmlClass});
+        canvas.setCurrentElement(el);
     }
 
 
     }