mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 06:56:01 +08:00
Merge pull request #3503 from paulkaplan/fix-name-anchoring
Fix missing bracket in name selector in url anchor jumping
This commit is contained in:
commit
3070a60597
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user