Permalink
Browse files

Stencil applies href to <a> immediately rather than on click.

Firefox (recently?) does not pick up changes to href in the click event.
  • Loading branch information...
1 parent ae383f6 commit e4527f2d72db6ec1f07aaeb758514879025ffa62 @joseph joseph committed Dec 13, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/controls/stencil.js
View
@@ -172,6 +172,11 @@ Monocle.Controls.Stencil = function (reader) {
function fixLink(link, hrefObject, handler) {
link.setAttribute('target', '_blank');
link.deconstructedHref = hrefObject;
+ if (hrefObject.external) {
+ link.href = hrefObject.external;
+ } else if (link.relatedLink) {
+ link.removeAttribute('href');
+ }
if (link.stencilClickHandler) { return; }
link.stencilClickHandler = handler;
Monocle.Events.listen(link, 'click', link.stencilClickHandler);
@@ -312,7 +317,6 @@ Monocle.Controls.Stencil = function (reader) {
return;
}
if (href.external) {
- link.href = href.external;
return;
}
var cmptId = href.componentId + href.hash;

0 comments on commit e4527f2

Please sign in to comment.