mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 07:13:08 -05:00
Fix reference to setPlaceholderTextNode
This is now an instance method, whereas before it was global. Annoyingly, we need to access this from from within fixCursor which has no reference to the RTE instance itself (and it would be a pain to pass one down). For now, just referring to the global `editor` variable if it exists (i.e. if the script loaded in an iframe). Need a better solution longer term though.
This commit is contained in:
parent
6b4dda816e
commit
fefa32b744
3 changed files with 11 additions and 9 deletions
|
@ -145,15 +145,14 @@ TreeWalker.prototype.previousNode = function () {
|
|||
SHOW_ELEMENT,
|
||||
FILTER_ACCEPT,
|
||||
FILTER_SKIP,
|
||||
win,
|
||||
isOpera,
|
||||
useTextFixer,
|
||||
cantFocusEmptyTextNodes,
|
||||
|
||||
TreeWalker,
|
||||
|
||||
Text,
|
||||
|
||||
setPlaceholderTextNode
|
||||
Text
|
||||
*/
|
||||
/*jshint strict:false */
|
||||
|
||||
|
@ -317,7 +316,9 @@ function fixCursor ( node ) {
|
|||
if ( !node.firstChild ) {
|
||||
if ( cantFocusEmptyTextNodes ) {
|
||||
fixer = doc.createTextNode( '\u200B' );
|
||||
setPlaceholderTextNode( fixer );
|
||||
if ( win.editor ) {
|
||||
win.editor._setPlaceholderTextNode( fixer );
|
||||
}
|
||||
} else {
|
||||
fixer = doc.createTextNode( '' );
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,15 +4,14 @@
|
|||
SHOW_ELEMENT,
|
||||
FILTER_ACCEPT,
|
||||
FILTER_SKIP,
|
||||
win,
|
||||
isOpera,
|
||||
useTextFixer,
|
||||
cantFocusEmptyTextNodes,
|
||||
|
||||
TreeWalker,
|
||||
|
||||
Text,
|
||||
|
||||
setPlaceholderTextNode
|
||||
Text
|
||||
*/
|
||||
/*jshint strict:false */
|
||||
|
||||
|
@ -176,7 +175,9 @@ function fixCursor ( node ) {
|
|||
if ( !node.firstChild ) {
|
||||
if ( cantFocusEmptyTextNodes ) {
|
||||
fixer = doc.createTextNode( '\u200B' );
|
||||
setPlaceholderTextNode( fixer );
|
||||
if ( win.editor ) {
|
||||
win.editor._setPlaceholderTextNode( fixer );
|
||||
}
|
||||
} else {
|
||||
fixer = doc.createTextNode( '' );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue