Browse Source

Un-inline some javascript

spaghetti 8 years ago
parent
commit
863c0f64b7
2 changed files with 6 additions and 2 deletions
  1. 2
    2
      design/privateheader.php
  2. 4
    0
      static/functions/global.js

+ 2
- 2
design/privateheader.php View File

145
 }
145
 }
146
 ?>
146
 ?>
147
 </head>
147
 </head>
148
-<body id="<?=$Document == 'collages' ? 'collage' : $Document?>" onclick="hide_header_links()">
148
+<body id="<?=$Document == 'collages' ? 'collage' : $Document?>">
149
   <div id="wrapper">
149
   <div id="wrapper">
150
     <h1 class="hidden"><?=SITE_NAME?></h1>
150
     <h1 class="hidden"><?=SITE_NAME?></h1>
151
     <div id="header">
151
     <div id="header">
363
         </ul>
363
         </ul>
364
         <ul id="userinfo_minor"<?=$NewSubscriptions ? ' class="highlite"' : ''?>>
364
         <ul id="userinfo_minor"<?=$NewSubscriptions ? ' class="highlite"' : ''?>>
365
           <li>
365
           <li>
366
-            <span class="brackets" onclick="toggle_header_links(event)">Links ▾</span>
366
+            <span id="header_links_menu" class="brackets">Links ▾</span>
367
             <ul>
367
             <ul>
368
               <li id="nav_inbox"<?=
368
               <li id="nav_inbox"<?=
369
                 Format::add_class($PageID, array('inbox'), 'active', true)?>>
369
                 Format::add_class($PageID, array('inbox'), 'active', true)?>>

+ 4
- 0
static/functions/global.js View File

192
 }
192
 }
193
 
193
 
194
 $(function() {
194
 $(function() {
195
+  if ($('#header_links_menu').length > 0) {
196
+    $('#header_links_menu')[0].addEventListener('click', toggle_header_links)
197
+    $('body')[0].addEventListener('click', hide_header_links)
198
+  }
195
   if ($('.request_table').length > 0) {
199
   if ($('.request_table').length > 0) {
196
     var a = $('[cover]')[0]
200
     var a = $('[cover]')[0]
197
     if (a) preload(a.attributes.cover.value)
201
     if (a) preload(a.attributes.cover.value)

Loading…
Cancel
Save