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

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

@@ -192,6 +192,10 @@ function ungetCover(event) {
192 192
 }
193 193
 
194 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 199
   if ($('.request_table').length > 0) {
196 200
     var a = $('[cover]')[0]
197 201
     if (a) preload(a.attributes.cover.value)

Loading…
Cancel
Save