mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 07:13:08 -05:00
Fix KB bold/italic etc. shortcuts in Webkit.
Webkit needs a special placeholder text node as it can't focus empty text nodes. This was being cleaned up too early, before the user had a chance to enter any text.
This commit is contained in:
parent
20f92c9785
commit
4c5b157d09
3 changed files with 5 additions and 3 deletions
|
@ -1277,6 +1277,7 @@ var willEnablePlaceholderRemoval = false;
|
|||
var enablePlaceholderRemoval = function () {
|
||||
mayRemovePlaceholder = true;
|
||||
willEnablePlaceholderRemoval = false;
|
||||
removeEventListener( 'keydown', enablePlaceholderRemoval );
|
||||
};
|
||||
|
||||
var removePlaceholderTextNode = function () {
|
||||
|
@ -1304,7 +1305,7 @@ var setPlaceholderTextNode = function ( node ) {
|
|||
removePlaceholderTextNode();
|
||||
}
|
||||
if ( !willEnablePlaceholderRemoval ) {
|
||||
setTimeout( enablePlaceholderRemoval, 0 );
|
||||
addEventListener( 'keydown', enablePlaceholderRemoval );
|
||||
willEnablePlaceholderRemoval = true;
|
||||
}
|
||||
mayRemovePlaceholder = false;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -198,6 +198,7 @@ var willEnablePlaceholderRemoval = false;
|
|||
var enablePlaceholderRemoval = function () {
|
||||
mayRemovePlaceholder = true;
|
||||
willEnablePlaceholderRemoval = false;
|
||||
removeEventListener( 'keydown', enablePlaceholderRemoval );
|
||||
};
|
||||
|
||||
var removePlaceholderTextNode = function () {
|
||||
|
@ -225,7 +226,7 @@ var setPlaceholderTextNode = function ( node ) {
|
|||
removePlaceholderTextNode();
|
||||
}
|
||||
if ( !willEnablePlaceholderRemoval ) {
|
||||
setTimeout( enablePlaceholderRemoval, 0 );
|
||||
addEventListener( 'keydown', enablePlaceholderRemoval );
|
||||
willEnablePlaceholderRemoval = true;
|
||||
}
|
||||
mayRemovePlaceholder = false;
|
||||
|
|
Loading…
Reference in a new issue