mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-10 09:24:22 +01:00
DRY up javascript for form visibility toggling.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@644 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
cb648ef141
commit
ae95f03c5b
6 changed files with 46 additions and 43 deletions
|
|
@ -19,7 +19,21 @@ var Login = {
|
|||
new CookieManager().setCookie('preferred_auth', 'database');
|
||||
}
|
||||
}
|
||||
|
||||
var TracksForm = {
|
||||
toggle: function(toggleDivId, formContainerId, formId, hideLinkText, hideLinkTitle, showLinkText, showLinkTitle) {
|
||||
$(formContainerId).toggle();
|
||||
toggleDiv = $(toggleDivId);
|
||||
toggleLink = toggleDiv.down('a');
|
||||
if (toggleDiv.hasClassName('hide_form')) {
|
||||
toggleLink.update(showLinkText).setAttribute('title', showLinkTitle);
|
||||
}
|
||||
else {
|
||||
toggleLink.update(hideLinkText).setAttribute('title', hideLinkTitle);
|
||||
Form.focusFirstElement(formId);
|
||||
}
|
||||
toggleDiv.toggleClassName('hide_form');
|
||||
}
|
||||
}
|
||||
Ajax.Responders.register({
|
||||
onCreate: function() {
|
||||
if($('busy') && Ajax.activeRequestCount>0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue