Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
c0d343ef
Commit
c0d343ef
authored
Nov 12, 2006
by
Nigel McNie
Committed by
Nigel McNie
Nov 12, 2006
Browse files
Added javascript to autofocus the first element with a class of 'autofocus'
on the page. Used by the form API.
parent
cf387e0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/js/mahara.js
View file @
c0d343ef
...
...
@@ -50,3 +50,15 @@ function processingStart(msg) {
function
processingStop
()
{
$
(
'
loading_box
'
).
style
.
display
=
'
none
'
;
}
// Autofocus the first element with a class of 'autofocus' on page load
addLoadEvent
(
function
()
{
getFirstElementByTagAndClassName
(
null
,
'
autofocus
'
,
document
.
body
).
focus
();
});
// @todo remove this when we migrate to mochikit 1.4
if
(
typeof
(
getFirstElementByTagAndClassName
)
==
'
undefined
'
)
{
function
getFirstElementByTagAndClassName
(
tag
,
className
,
parentElement
)
{
return
getElementsByTagAndClassName
(
tag
,
className
,
parentElement
)[
0
];
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment