Merge pull request #3503 from paulkaplan/fix-name-anchoring

Fix missing bracket in name selector in url anchor jumping
This commit is contained in:
Régis Hanol 2015-05-26 15:52:44 +02:00
commit 3070a60597

View File

@ -89,7 +89,7 @@ Discourse.URL = Ember.Object.createWithMixins({
Em.run.schedule('afterRender', function() { Em.run.schedule('afterRender', function() {
var $elem = $(id); var $elem = $(id);
if ($elem.length === 0) { if ($elem.length === 0) {
$elem = $("[name=" + id.replace('#', '')); $elem = $("[name='" + id.replace('#', '') + "']");
} }
if ($elem.length > 0) { if ($elem.length > 0) {
$('html,body').scrollTop($elem.offset().top - $('header').height() - 15); $('html,body').scrollTop($elem.offset().top - $('header').height() - 15);