FIX: Allow links to `name` attributes

This commit is contained in:
Robin Ward 2014-08-19 16:51:53 -04:00
parent 5667cfe6cb
commit 65297533fa
1 changed files with 3 additions and 0 deletions

View File

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