Skip to content

Node.js based forum software built for the modern web

fixed issue where outgoing links warning page would intercept clicks to the search button in the headerbar (thanks @dove)

Julian Lam0ea09972b4c7
diff --git a/public/src/app.js b/public/src/app.js
index 327b63b5d4..e467343a39 100644
--- a/public/src/app.js
+++ b/public/src/app.js
@@ -420,7 +420,9 @@ var socket,
titles: []
};
app.alternatingTitle = function (title) {
- if (typeof title !== 'string') return;
+ if (typeof title !== 'string') {
+ return;
+ }
if (title.length > 0) {
titleObj.titles[1] = title;
@@ -434,7 +436,9 @@ var socket,
if (titleObj.interval) {
clearInterval(titleObj.interval);
}
- if (titleObj.titles[0]) window.document.title = titleObj.titles[0];
+ if (titleObj.titles[0]) {
+ window.document.title = titleObj.titles[0];
+ }
}
};
@@ -452,7 +456,8 @@ var socket,
};
app.updateHeader = function(data) {
- $('#search-button').on('click', function() {
+ $('#search-button').off().on('click', function(e) {
+ e.stopPropagation();
$('#search-fields').removeClass('hide').show();
$(this).hide();
$('#search-fields input').focus();
@@ -484,12 +489,15 @@ var socket,
var userLabel = loggedInMenu.find('#user_label');
if (userLabel.length) {
- if (data['userslug'])
- userLabel.find('#user-profile-link').attr('href', RELATIVE_PATH + '/user/' + data['userslug']);
- if (data['picture'])
- userLabel.find('img').attr('src', data['picture']);
- if (data['username'])
- userLabel.find('span').html(data['username']);
+ if (data.userslug) {
+ userLabel.find('#user-profile-link').attr('href', RELATIVE_PATH + '/user/' + data.userslug);
+ }
+ if (data.picture) {
+ userLabel.find('img').attr('src', data.picture);
+ }
+ if (data.username) {
+ userLabel.find('span').html(data.username);
+ }
$('#logout-link').on('click', app.logout);
}
@@ -511,8 +519,9 @@ var socket,
}
$('#main-nav a,#user-control-list a,#logged-out-menu li a').off('click').on('click', function() {
- if($('.navbar .navbar-collapse').hasClass('in'))
+ if($('.navbar .navbar-collapse').hasClass('in')) {
$('.navbar-header button').click();
+ }
});
};
diff --git a/public/templates/header.tpl b/public/templates/header.tpl
index 58284e41da..1eafdea419 100644
--- a/public/templates/header.tpl
+++ b/public/templates/header.tpl
@@ -54,7 +54,6 @@
<div class="navbar-collapse collapse navbar-ex1-collapse">
<ul id="main-nav" class="nav navbar-nav">
-
<li>
<a href="{relative_path}/recent"><i class="fa fa-fw fa-clock-o" title="[[global:header.recent]]"></i><span class="visible-xs-inline"> [[global:header.recent]]</span></a>
</li>
@@ -150,7 +149,7 @@
</li>
<li class="hidden-xs">
- <a id="search-button" class="hide"><i class="fa fa-search"></i></a>
+ <a href="#" id="search-button" class="hide"><i class="fa fa-search"></i></a>
</li>
</ul>