Index: trunk/extensions/MobileFrontend/javascripts/application.js |
— | — | @@ -45,10 +45,7 @@ |
46 | 46 | } |
47 | 47 | } |
48 | 48 | |
49 | | -// I don't think this makes sense. Loading this here means that this button |
50 | | -// won't function until the page is loaded. It would probably be an |
51 | | -// improvement to just attach an onclick straight into the html. |
52 | | -document.getElementById( 'logo' ).onclick = function() { |
| 49 | +function logoClick() { |
53 | 50 | var n = document.getElementById( 'nav' ).style; |
54 | 51 | n.display = n.display == 'block' ? 'none' : 'block'; |
55 | 52 | if (n.display == 'block') { |
Index: trunk/extensions/MobileFrontend/views/layout/_search_webkit.html.php |
— | — | @@ -16,10 +16,12 @@ |
17 | 17 | $languageSelectionText = '<b>' . self::$messages['mobile-frontend-language'] . ':</b><br/>'; |
18 | 18 | $languageSelectionDiv = ( self::$isBetaGroupMember ) ? '<div id="languageselectionsection">' . $languageSelectionText . $languageSelection . '</div>' : ''; |
19 | 19 | |
| 20 | +$logoOnClick = (self::$device['supports_javascript']) ? 'onclick="javascript:logoClick();"' : ''; |
| 21 | + |
20 | 22 | $searchWebkitHtml = <<<EOD |
21 | 23 | <div id='header'> |
22 | 24 | <div id='searchbox'> |
23 | | - <img width="35" height="22" alt='Logo' id='logo' src='{$wgMobileFrontendLogo}' /> |
| 25 | + <img width="35" height="22" alt='Logo' id='logo' src='{$wgMobileFrontendLogo}' {$logoOnClick} /> |
24 | 26 | <form action='{$scriptUrl}' class='search_bar' method='get' {$searchBoxDisplayNone}> |
25 | 27 | <input type="hidden" value="Special:Search" name="title" /> |
26 | 28 | <div id="sq" class="divclearable"> |