witten
/
luminotes
Archived
1
0
Fork 0

Now ignoring link clicks that are with the right or middle mouse buttons.

This commit is contained in:
Dan Helfman 2007-07-27 00:32:42 +00:00
parent ccc1cc2f2d
commit 35459270be
2 changed files with 18 additions and 5 deletions

View File

@ -250,6 +250,10 @@ Editor.prototype.key_released = function ( event ) {
}
Editor.prototype.mouse_clicked = function ( event ) {
// we only want to deal with left mouse button clicks
if ( event.mouse().button.middle || event.mouse().button.right )
return;
event.stop();
signal( this, "state_changed", this );

View File

@ -16,7 +16,8 @@ function Wiki() {
if ( this.notebook_id ) {
this.invoker.invoke(
"/notebooks/contents", "GET", {
"notebook_id": this.notebook_id
"notebook_id": this.notebook_id,
"note_id": getElement( "note_id" ).value
},
function( result ) { self.populate( result ); }
);
@ -121,9 +122,17 @@ Wiki.prototype.populate = function ( result ) {
var note = this.notebook.startup_notes[ i ];
if ( !note ) continue;
this.startup_notes[ note.object_id ] = true;
var focus = ( i == 0 );
this.create_editor( note.object_id, note.contents, note.revisions_list, undefined, undefined, false, focus );
// don't actually create an editor if a particular note was provided in the result
if ( !result.note ) {
var focus = ( i == 0 );
this.create_editor( note.object_id, note.contents, note.revisions_list, undefined, undefined, false, focus );
}
}
// if one particular note was provided, then just display an editor for that note
if ( result.note )
this.create_editor( result.note.object_id, result.note.contents, result.note.revisions_list, undefined, undefined, false, true );
}
Wiki.prototype.background_clicked = function ( event ) {
@ -575,7 +584,7 @@ Pulldown.prototype.shutdown = function () {
}
Options_pulldown = function ( notebook_id, invoker, editor ) {
function Options_pulldown( notebook_id, invoker, editor ) {
Pulldown.call( this, notebook_id, "options_" + editor.id, editor.options_button );
this.invoker = invoker;
@ -620,7 +629,7 @@ Options_pulldown.prototype.shutdown = function () {
}
Changes_pulldown = function ( notebook_id, invoker, editor ) {
function Changes_pulldown( notebook_id, invoker, editor ) {
Pulldown.call( this, notebook_id, "changes_" + editor.id, editor.changes_button );
this.invoker = invoker;