Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js |
— | — | @@ -55,7 +55,7 @@ |
56 | 56 | } ); |
57 | 57 | } |
58 | 58 | ) |
59 | | - .bind( 'mouseup scrollToPosition', |
| 59 | + .bind( 'mouseup scrollToPosition focus', |
60 | 60 | function( event ) { |
61 | 61 | var context = $(this).data( 'context' ); |
62 | 62 | $(this).eachAsync( { |
— | — | @@ -65,15 +65,22 @@ |
66 | 66 | } |
67 | 67 | } ); |
68 | 68 | } |
69 | | - ); |
| 69 | + ) |
| 70 | + .blur( function() { |
| 71 | + $.wikiEditor.modules.toc.fn.unhighlight( context ); |
| 72 | + }); |
70 | 73 | }, |
| 74 | + |
| 75 | + unhighlight: function( context ) { |
| 76 | + context.modules.$toc.find( 'a' ).removeClass( 'currentSelection' ); |
| 77 | + }, |
71 | 78 | /** |
72 | 79 | * Highlight the section the cursor is currently within |
73 | 80 | * |
74 | 81 | * @param {Object} context |
75 | 82 | */ |
76 | 83 | update: function( context ) { |
77 | | - context.modules.$toc.find( 'a' ).removeClass( 'currentSelection' ); |
| 84 | + $.wikiEditor.modules.toc.fn.unhighlight( context ); |
78 | 85 | var position = context.$textarea.getCaretPosition(); |
79 | 86 | var section = 0; |
80 | 87 | if ( context.data.outline.length > 0 ) { |