Skip to content

Commit 9378c34

Browse files
author
Oliver Pulges
committed
Update to v0.4.12
1 parent 1c3b798 commit 9378c34

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

lib/wysihtml5x/rails/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Wysihtml5x
22
module Rails
3-
VERSION = "0.4.11"
3+
VERSION = "0.4.12"
44
end
55
end

vendor/assets/javascripts/wysihtml5x-toolbar.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if(!Array.isArray) {
2525
return Object.prototype.toString.call(arg) === '[object Array]';
2626
};
2727
};/**
28-
* @license wysihtml5x v0.4.11
28+
* @license wysihtml5x v0.4.12
2929
* https://github.com/Edicy/wysihtml5
3030
*
3131
* Author: Christopher Blum (https://github.com/tiff)
@@ -36,7 +36,7 @@ if(!Array.isArray) {
3636
*
3737
*/
3838
var wysihtml5 = {
39-
version: "0.4.11",
39+
version: "0.4.12",
4040

4141
// namespaces
4242
commands: {},
@@ -7046,6 +7046,13 @@ wysihtml5.dom.replaceWithChildNodes = function(node) {
70467046
unset = function() {
70477047
if (view.hasPlaceholderSet()) {
70487048
view.clear();
7049+
view.element.focus();
7050+
setTimeout(function() {
7051+
var sel = view.selection.getSelection();
7052+
if (!sel.focusNode || !sel.anchorNode) {
7053+
view.selection.selectNode(view.element.firstChild || view.element);
7054+
}
7055+
}, 0);
70497056
}
70507057
view.placeholderSet = false;
70517058
dom.removeClass(view.element, CLASS_NAME);
@@ -11845,7 +11852,7 @@ wysihtml5.views.View = Base.extend(
1184511852

1184611853
isEmpty: function() {
1184711854
var innerHTML = this.element.innerHTML.toLowerCase();
11848-
return (/^\s*$/i).test(innerHTML) ||
11855+
return (/^(\s|<br>|<\/br>|<p>|<\/p>)*$/i).test(innerHTML) ||
1184911856
innerHTML === "" ||
1185011857
innerHTML === "<br>" ||
1185111858
innerHTML === "<p></p>" ||

vendor/assets/javascripts/wysihtml5x.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if(!Array.isArray) {
2525
return Object.prototype.toString.call(arg) === '[object Array]';
2626
};
2727
};/**
28-
* @license wysihtml5x v0.4.11
28+
* @license wysihtml5x v0.4.12
2929
* https://github.com/Edicy/wysihtml5
3030
*
3131
* Author: Christopher Blum (https://github.com/tiff)
@@ -36,7 +36,7 @@ if(!Array.isArray) {
3636
*
3737
*/
3838
var wysihtml5 = {
39-
version: "0.4.11",
39+
version: "0.4.12",
4040

4141
// namespaces
4242
commands: {},
@@ -7046,6 +7046,13 @@ wysihtml5.dom.replaceWithChildNodes = function(node) {
70467046
unset = function() {
70477047
if (view.hasPlaceholderSet()) {
70487048
view.clear();
7049+
view.element.focus();
7050+
setTimeout(function() {
7051+
var sel = view.selection.getSelection();
7052+
if (!sel.focusNode || !sel.anchorNode) {
7053+
view.selection.selectNode(view.element.firstChild || view.element);
7054+
}
7055+
}, 0);
70497056
}
70507057
view.placeholderSet = false;
70517058
dom.removeClass(view.element, CLASS_NAME);
@@ -11845,7 +11852,7 @@ wysihtml5.views.View = Base.extend(
1184511852

1184611853
isEmpty: function() {
1184711854
var innerHTML = this.element.innerHTML.toLowerCase();
11848-
return (/^\s*$/i).test(innerHTML) ||
11855+
return (/^(\s|<br>|<\/br>|<p>|<\/p>)*$/i).test(innerHTML) ||
1184911856
innerHTML === "" ||
1185011857
innerHTML === "<br>" ||
1185111858
innerHTML === "<p></p>" ||

0 commit comments

Comments
 (0)