Fixed a rare Chrome/Safari bug in which pressing backspace sometimes made the text cursor vanish.
This commit is contained in:
parent
6b7ad59001
commit
0b2b0ec69e
2
NEWS
2
NEWS
|
@ -1,5 +1,7 @@
|
|||
1.5.9:
|
||||
* Fixed a Chrome/Safari bug in which ending a link didn't always work.
|
||||
* Fixed a rare Chrome/Safari bug in which pressing backspace sometimes made
|
||||
the text cursor vanish.
|
||||
|
||||
1.5.8: November 24, 2008
|
||||
* Fixed a bug that prevented notes from being automatically saved in certain
|
||||
|
|
|
@ -329,10 +329,14 @@ Editor.prototype.key_released = function ( event ) {
|
|||
Editor.prototype.cleanup_html = function ( key_code ) {
|
||||
if ( WEBKIT ) {
|
||||
// if enter is pressed while in a title, end title mode, since WebKit doesn't do that for us
|
||||
var ENTER = 13;
|
||||
var ENTER = 13; BACKSPACE = 8;
|
||||
if ( key_code == ENTER && this.state_enabled( "h3" ) )
|
||||
this.exec_command( "h3" );
|
||||
|
||||
// if backspace is pressed, skip WebKit style scrubbing since it can cause problems
|
||||
if ( key_code == BACKSPACE )
|
||||
return null;
|
||||
|
||||
// as of this writing, WebKit doesn't support execCommand( "styleWithCSS" ). for more info, see
|
||||
// https://bugs.webkit.org/show_bug.cgi?id=13490
|
||||
// so to make up for this shortcoming, manually scrub WebKit style spans and other nodes,
|
||||
|
|
|
@ -1073,6 +1073,10 @@ Wiki.prototype.key_pressed = function ( event ) {
|
|||
if ( code == 78 )
|
||||
this.create_blank_editor( event );
|
||||
}
|
||||
|
||||
// prevent backspace from going back to the previous page
|
||||
if ( code == 8 )
|
||||
event.stop();
|
||||
}
|
||||
|
||||
Wiki.prototype.editor_key_pressed = function ( editor, event ) {
|
||||
|
|
Reference in New Issue