Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

wip

  • Loading branch information...
commit 318cc78c3e8d06dee02f2e6e7e24e08fd3d2e1d9 1 parent 0cccddb
Christopher Blum tiff authored
2  examples/advanced.html
View
@@ -38,7 +38,7 @@
#toolbar,
textarea {
- width: 900px;
+ width: 920px;
padding: 5px;
-webkit-box-sizing: border-box;
-ms-box-sizing: border-box;
8 src/commands/insertOrderedList.js
View
@@ -8,7 +8,7 @@ wysihtml5.commands.insertOrderedList = {
isEmpty,
tempElement;
- if (composer.commands.support(command)) {
+ if (!list && !otherList && composer.commands.support(command)) {
doc.execCommand(command, false, null);
return;
}
@@ -18,7 +18,7 @@ wysihtml5.commands.insertOrderedList = {
// <ol><li>foo</li><li>bar</li></ol>
// becomes:
// foo<br>bar<br>
- composer.selection.executeAndRestoreSimple(function() {
+ composer.selection.executeAndRestore(function() {
wysihtml5.dom.resolveList(list, composer.config.useLineBreaks);
});
} else if (otherList) {
@@ -26,7 +26,7 @@ wysihtml5.commands.insertOrderedList = {
// <ul><li>foo</li><li>bar</li></ul>
// becomes:
// <ol><li>foo</li><li>bar</li></ol>
- composer.selection.executeAndRestoreSimple(function() {
+ composer.selection.executeAndRestore(function() {
wysihtml5.dom.renameElement(otherList, "ol");
});
} else {
@@ -34,7 +34,7 @@ wysihtml5.commands.insertOrderedList = {
composer.commands.exec("formatBlock", "div", tempClassName);
tempElement = doc.querySelector("." + tempClassName);
isEmpty = tempElement.innerHTML === "" || tempElement.innerHTML === wysihtml5.INVISIBLE_SPACE || tempElement.innerHTML === "<br>";
- composer.selection.executeAndRestoreSimple(function() {
+ composer.selection.executeAndRestore(function() {
list = wysihtml5.dom.convertToList(tempElement, "ol");
});
if (isEmpty) {
8 src/commands/insertUnorderedList.js
View
@@ -8,7 +8,7 @@ wysihtml5.commands.insertUnorderedList = {
isEmpty,
tempElement;
- if (composer.commands.support(command)) {
+ if (!list && !otherList && composer.commands.support(command)) {
doc.execCommand(command, false, null);
return;
}
@@ -18,7 +18,7 @@ wysihtml5.commands.insertUnorderedList = {
// <ul><li>foo</li><li>bar</li></ul>
// becomes:
// foo<br>bar<br>
- composer.selection.executeAndRestoreSimple(function() {
+ composer.selection.executeAndRestore(function() {
wysihtml5.dom.resolveList(list, composer.config.useLineBreaks);
});
} else if (otherList) {
@@ -26,7 +26,7 @@ wysihtml5.commands.insertUnorderedList = {
// <ol><li>foo</li><li>bar</li></ol>
// becomes:
// <ul><li>foo</li><li>bar</li></ul>
- composer.selection.executeAndRestoreSimple(function() {
+ composer.selection.executeAndRestore(function() {
wysihtml5.dom.renameElement(otherList, "ul");
});
} else {
@@ -34,7 +34,7 @@ wysihtml5.commands.insertUnorderedList = {
composer.commands.exec("formatBlock", "div", tempClassName);
tempElement = doc.querySelector("." + tempClassName);
isEmpty = tempElement.innerHTML === "" || tempElement.innerHTML === wysihtml5.INVISIBLE_SPACE || tempElement.innerHTML === "<br>";
- composer.selection.executeAndRestoreSimple(function() {
+ composer.selection.executeAndRestore(function() {
list = wysihtml5.dom.convertToList(tempElement, "ul");
});
if (isEmpty) {
Please sign in to comment.
Something went wrong with that request. Please try again.