diff --git a/lib/gollum/frontend/public/javascript/gollum-editor/gollum.editor.js b/lib/gollum/frontend/public/javascript/gollum-editor/gollum.editor.js index bba422db..cf5560c0 100755 --- a/lib/gollum/frontend/public/javascript/gollum-editor/gollum.editor.js +++ b/lib/gollum/frontend/public/javascript/gollum-editor/gollum.editor.js @@ -550,6 +550,9 @@ // deactivate the function bar; it's not gonna work now FunctionBar.deactivate(); } + if ( Help.isShown() ) { + Help.hide(); + } } } }, @@ -775,6 +778,27 @@ }, + hide: function() { + $('#gollum-editor-help').animate({ + opacity: 0 + }, 200, + function() { + $('#gollum-editor-help') + .animate({ height: 'hide' }, 200); + }); + }, + + show: function() { + $('#gollum-editor-help').animate({ + height: 'show' + }, 200, + function() { + $('#gollum-editor-help') + .animate({ opacity: 1 }, 300); + }); + }, + + /** * Help.showHelpFor * Displays the actual help content given the two menu indexes, which are @@ -809,6 +833,11 @@ }, + isShown: function() { + return ( $('#gollum-editor-help').is(':visible') ); + }, + + /** * Help.isValidHelpFormat * Does a quick check to make sure that the help definition isn't in a @@ -862,25 +891,8 @@ */ evtHelpButtonClick: function( e ) { e.preventDefault(); - - // cascaded animations are prettier - if ( $('#gollum-editor-help').is(':visible') ) { - $('#gollum-editor-help').animate({ - opacity: 0 - }, 200, - function() { - $('#gollum-editor-help') - .animate({ height: 'hide' }, 200); - }); - } else { - $('#gollum-editor-help').animate({ - height: 'show' - }, 200, - function() { - $('#gollum-editor-help') - .animate({ opacity: 1 }, 300); - }); - } + if ( Help.isShown() ) Help.hide(); + else Help.show(); }, diff --git a/scratch/TODO b/scratch/TODO index e0a3cffe..d5033f93 100755 --- a/scratch/TODO +++ b/scratch/TODO @@ -3,8 +3,6 @@ * IE7 Styles * Fix how text selections occur in IE7/8 so we actually get the right text * Figure out why Dialogs won't fire in IE7 (likely a css issue) -* Hide help if the new JS file doesn't have working help. -* Hide function bar if language definition is malformed (non-404 results) * Write Editor/Sidebar implementation notes for Rick * Find some clever way to represent page hierarchy.