Hide help if there is no help definition for the given language

This commit is contained in:
Eston Bond
2010-12-01 18:27:20 -08:00
parent 4222289236
commit 4fb36dc263
2 changed files with 31 additions and 21 deletions
@@ -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();
},
-2
View File
@@ -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.