@@ -28,20 +28,6 @@ function setProps(elem, node) {
28 node.id = props.tag;
28 node.id = props.tag;
31− if (props.href !== '') {
32− var a = newElement('a');
34− a.style.width = '100%';
35− a.style.height = '100%';
38− a.style.display = 'block';
39− a.style.position = 'absolute';
40− node.style.position = 'relative';
41− a.style.pointerEvents = 'auto';
45 if (props.hover.ctor !== '_Tuple0') {
31 if (props.hover.ctor !== '_Tuple0') {
46 addHover(node, props.hover);
32 addHover(node, props.hover);
@@ -50,6 +36,15 @@ function setProps(elem, node) {
50 addClick(node, props.click);
36 addClick(node, props.click);
39+ if (props.href !== '') {
40+ var anchor = newElement('a');
41+ anchor.href = props.href;
42+ anchor.style.display = 'block';
43+ anchor.style.pointerEvents = 'auto';
44+ anchor.appendChild(node);
53 return node;
48 return node;
@@ -394,19 +389,21 @@ function updateProps(node, curr, next) {
395 if (nextProps.href !== currProps.href) {
390 if (nextProps.href !== currProps.href) {
396 if (currProps.href === '') {
391 if (currProps.href === '') {
392+ // add a surrounding href
397− var a = newElement('a');
393+ var anchor = newElement('a');
398− a.href = nextProps.href;
394+ anchor.href = nextProps.href;
399− a.style.width = '100%';
400− a.style.height = '100%';
403− a.style.display = 'block';
395+ anchor.style.display = 'block';
404− a.style.position = 'absolute';
405− node.style.position = 'relative';
406− a.style.pointerEvents = 'auto';
396+ anchor.style.pointerEvents = 'auto';
398+ node.parentNode.replaceChild(anchor, node);
407− node.appendChild(a);
399+ anchor.appendChild(node);
400+ } else if (nextProps.href === '') {
401+ // remove the surrounding href
402+ var anchor = node.parentNode;
403+ anchor.parentNode.replaceChild(node, anchor);
405+ // just update the link
409− node.lastNode.href = nextProps.href;
406+ node.parentNode.href = nextProps.href;