Use <script> instead of inline event handler in print_fieldset()
This commit is contained in:
parent
a5ee3451ac
commit
6b2ba65084
|
@ -200,11 +200,14 @@ function confirm($selector = "qsl('input')") {
|
||||||
* @param string
|
* @param string
|
||||||
* @param string
|
* @param string
|
||||||
* @param bool
|
* @param bool
|
||||||
* @param string
|
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
function print_fieldset($id, $legend, $visible = false, $onclick = "") {
|
function print_fieldset($id, $legend, $visible = false) {
|
||||||
echo "<fieldset><legend><a href='#fieldset-$id' onclick=\"" . h($onclick) . "return toggle('fieldset-$id');\">$legend</a></legend><div id='fieldset-$id'" . ($visible ? "" : " class='hidden'") . ">\n";
|
echo "<fieldset><legend>";
|
||||||
|
echo "<a href='#fieldset-$id'>$legend</a>";
|
||||||
|
echo "<script>qsl('a').onclick = partial(toggle, 'fieldset-$id');</script>";
|
||||||
|
echo "</legend>";
|
||||||
|
echo "<div id='fieldset-$id'" . ($visible ? "" : " class='hidden'") . ">\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return class='active' if $bold is true
|
/** Return class='active' if $bold is true
|
||||||
|
|
Loading…
Reference in a new issue