- canvas.wlxmlDocument.startTransaction();
- added = currentElement.data('wlxmlNode').after({
- tagName: currentElement.getWlxmlTag() || 'div',
- attrs: {'class': currentElement.getWlxmlClass() || 'p'}
+ canvas.wlxmlDocument.transaction(function() {
+ var added = currentElement.wlxmlNode.after({
+ tagName: currentElement.wlxmlNode.getTagName() || 'div',
+ attrs: {'class': currentElement.getWlxmlClass() || 'p'}
+ });
+ added.append({text:''});
+ return added;
+ }, {
+ metadata: {
+ description: gettext('Splitting text')
+ },
+ success: function(ret) {
+ canvas.setCurrentElement(utils.getElementForNode(ret), {caretTo: 'start'});
+ }