witten
/
luminotes
Archived
1
0
Fork 0

Selecting all text in link pulldown's title field only on focus not, not every click.

This commit is contained in:
Dan Helfman 2007-08-20 18:43:45 +00:00
parent 59fdcd2340
commit f4428c65ba
1 changed files with 5 additions and 1 deletions

View File

@ -963,6 +963,7 @@ function Link_pulldown( wiki, notebook_id, invoker, editor, link ) {
var self = this;
connect( this.title_field, "onclick", function ( event ) { self.title_field_clicked( event ); } );
connect( this.title_field, "onfocus", function ( event ) { self.title_field_focused( event ); } );
connect( this.title_field, "onchange", function ( event ) { self.title_field_changed( event ); } );
connect( this.title_field, "onblur", function ( event ) { self.title_field_changed( event ); } );
connect( this.title_field, "onkeydown", function ( event ) { self.title_field_key_pressed( event ); } );
@ -1062,10 +1063,13 @@ Link_pulldown.prototype.display_preview = function ( title, contents ) {
}
Link_pulldown.prototype.title_field_clicked = function ( event ) {
this.title_field.select();
event.stop();
}
Link_pulldown.prototype.title_field_focused = function ( event ) {
this.title_field.select();
}
Link_pulldown.prototype.title_field_changed = function ( event ) {
// if the title is actually unchanged, then bail
if ( this.title_field.value == this.previous_title )