Rudimentary anchor name escaping

This commit is contained in:
Thomas Gelf 2014-03-20 14:07:43 +00:00
parent 292ce6e12b
commit e1de4e384a
1 changed files with 1 additions and 1 deletions

View File

@ -122,7 +122,7 @@
scrollContainerToAnchor: function ($container, anchorName) {
// TODO: Generic issue -> we probably should escape attribute value selectors!?
var $anchor = $("a[name='" + anchorName + "']", $container);
var $anchor = $("a[name='" + anchorName.replace(/'/, '\\\'') + "']", $container);
if ($anchor.length) {
$container.scrollTop(0);
$container.scrollTop($anchor.first().position().top);