Fixing issue 989 (#997)

* Fixing issue 989

Signed-off-by: Moshe Wajnberg <wajnberg@il.ibm.com>

* Fixing the getRangeAt problem on Chrome

Signed-off-by: Moshe Wajnberg <wajnberg@il.ibm.com>

* Fixing the getRangeAt problem on Chrome

Signed-off-by: Moshe Wajnberg <wajnberg@il.ibm.com>
This commit is contained in:
wajnberg 2016-09-18 23:20:50 +03:00 committed by Nick O'Leary
parent 55d7420abf
commit b9da1f18b4
3 changed files with 9 additions and 3 deletions

View File

@ -1237,11 +1237,12 @@ RED.text.format = (function() {
function displayWithStructure(element) {
var txt = element.textContent || "";
if (txt.length === 0) {
var selection = document.getSelection();
if (txt.length === 0 || !selection || selection.rangeCount <= 0) {
element.dispatchEvent(event);
return;
}
var selection = document.getSelection();
var range = selection.getRangeAt(0);
var tempRange = range.cloneRange(), startNode, startOffset;
startNode = range.startContainer;

View File

@ -196,7 +196,7 @@
display: inline-block;
width: 100px;
}
.form-row input .form-row div[contenteditable="true"] {
.form-row input, .form-row div[contenteditable="true"] {
width:70%;
}

View File

@ -1082,3 +1082,8 @@ legend + .control-group {
.form-horizontal .form-actions {
padding-left: 180px;
}
.form-row div[contenteditable="true"] {
white-space: nowrap;
overflow: hidden;
}