]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
ipfire theme: Add missing swapVisibility javascript function
authorAlf Høgemark <alf@i100.no>
Wed, 19 Feb 2014 17:05:55 +0000 (18:05 +0100)
committerAlf Høgemark <alf@i100.no>
Wed, 19 Feb 2014 17:05:55 +0000 (18:05 +0100)
qos.cgi and media.cgi depend on swapVisibility function, this
is defined in each theme, but was missing from the new theme.

Add the function, and implement it using jquery, since jquery
is always present in the new theme.

html/html/themes/ipfire/include/functions.pl

index 44ed9b75841600cdc1703ca6702ed6c8b5575ef0..b3b26b96a84ddb014446f50ce5b9253c57fc95c6 100644 (file)
@@ -128,6 +128,12 @@ print <<END;
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <link rel="shortcut icon" href="/favicon.ico" />
        <script type="text/javascript" src="/include/jquery.js"></script>
+
+       <script language="javascript" type="text/javascript">
+               function swapVisibility(id) {
+                       \$('#' + id).toggle();
+               }
+       </script>
 END
 
        foreach my $stylesheet (@stylesheets) {