lilium-text
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -149,3 +149,3 @@ "use strict"; | ||
while (leftEl.firstChild != placeholder) { | ||
while (leftEl.firstChild && leftEl.firstChild != placeholder) { | ||
clone.appendChild(leftEl.firstChild); | ||
@@ -724,2 +724,25 @@ } | ||
}, { | ||
key: "insertBlock", | ||
value: function insertBlock(element) { | ||
var selection = this.restoreSelection(); | ||
var context = this.createSelectionContext(selection.focusNode); | ||
var ctxElem = context[context.length - 1]; | ||
if (ctxElem && ctxElem.element.nextElementSibling) { | ||
var curParag = ctxElem.element; | ||
if (curParag) { | ||
curParag.parentElement.insertBefore(element, curParag.nextElementSibling); | ||
} | ||
} else { | ||
this.contentel.appendChild(element); | ||
} | ||
var range = selection.getRangeAt(0).cloneRange(); | ||
range.setEndAfter(element); | ||
range.collapse(false); | ||
selection.removeAllRanges(); | ||
selection.addRange(range); | ||
} | ||
}, { | ||
key: "_focused", | ||
@@ -726,0 +749,0 @@ value: function _focused() { |
{ | ||
"name": "lilium-text", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Web rich text editor. Not ready to be used at all.", | ||
@@ -5,0 +5,0 @@ "main": "build/liliumtext.js", |
# Lilium Text | ||
A lightweight, dependency-free, extensible text editor. | ||
![First Screenshot](https://erikdesjardins.com/static/git/liliumtext-1.jpg) | ||
![First Screenshot](https://raw.githubusercontent.com/rykdesjardins/lilium-text/master/assets/screenshot.png) | ||
@@ -6,0 +6,0 @@ ## About the project |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1372644
24
1830