witten
/
luminotes
Archived
1
0
Fork 0

Reverting r333 and making alternate fix for duplicate notes when repeatedly

clicking links, because r333 broke link pulldown title grabbing. Must..
write.. unit.. tests!
This commit is contained in:
Dan Helfman 2007-09-06 08:27:41 +00:00
parent ae342ac5d6
commit e747e9c2ff
1 changed files with 14 additions and 11 deletions

View File

@ -267,7 +267,9 @@ Wiki.prototype.load_editor = function ( note_title, note_id, revision, link ) {
link.removeAttribute( "target" ); link.removeAttribute( "target" );
} }
// if the note corresponding to the link's id is already open, highlight it and bail // if the note corresponding to the link's id is already open, highlight it and bail, but only if
// we didn't pull a title from an open link pulldown
if ( !pulldown_title ) {
if ( revision ) if ( revision )
var iframe = getElement( "note_" + note_id + " " + revision ); var iframe = getElement( "note_" + note_id + " " + revision );
else else
@ -279,6 +281,7 @@ Wiki.prototype.load_editor = function ( note_title, note_id, revision, link ) {
link.href = "/notebooks/" + this.notebook_id + "?note_id=" + note_id; link.href = "/notebooks/" + this.notebook_id + "?note_id=" + note_id;
return; return;
} }
}
// if the note_title corresponds to a "magic" note's title, then dynamically create the note // if the note_title corresponds to a "magic" note's title, then dynamically create the note
var self = this; var self = this;
@ -297,7 +300,7 @@ Wiki.prototype.load_editor = function ( note_title, note_id, revision, link ) {
} }
// if there's not a valid destination note id, then load by title instead of by id // if there's not a valid destination note id, then load by title instead of by id
if ( note_id == undefined || note_id == "new" || note_id == "null" ) { if ( pulldown_title || note_id == undefined || note_id == "new" || note_id == "null" ) {
// but if the note corresponding to the link's title is already open, highlight it and bail // but if the note corresponding to the link's title is already open, highlight it and bail
if ( !revision ) { if ( !revision ) {
var editor = this.open_editors[ note_title ]; var editor = this.open_editors[ note_title ];