Skip to content
This repository was archived by the owner on Apr 16, 2019. It is now read-only.

Commit 2b87271

Browse files
author
langowskiadam
committed
add customClickHandler in checkAnchorClick
1 parent e00c944 commit 2b87271

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

build/appframework.ui.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/*! intel-appframework - v3.0.0 - 2015-03-29 */
2-
31
/**
42
* af.shim.js
53
* @copyright Intel 2014
@@ -1473,7 +1471,12 @@ window.af=window.jq=jQuery;
14731471
if (theTarget === document) {
14741472
return;
14751473
}
1474+
var custom = (typeof $.afui.customClickHandler === "function") ? $.afui.customClickHandler : false;
1475+
if (custom !== false) {
1476+
if ($.afui.customClickHandler(theTarget.getAttribute("href"),e)) return e.preventDefault();
14761477

1478+
}
1479+
14771480
//this technique fails when considerable content exists inside anchor, should be recursive ?
14781481
if (theTarget.tagName.toLowerCase() !== "a" && theTarget.parentNode) return checkAnchorClick(e, theTarget.parentNode); //let's try the parent (recursive)
14791482
//anchors

src/af.ui.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,12 @@
11611161
if (theTarget === document) {
11621162
return;
11631163
}
1164+
var custom = (typeof $.afui.customClickHandler === "function") ? $.afui.customClickHandler : false;
1165+
if (custom !== false) {
1166+
if ($.afui.customClickHandler(theTarget.getAttribute("href"),e)) return e.preventDefault();
11641167

1168+
}
1169+
11651170
//this technique fails when considerable content exists inside anchor, should be recursive ?
11661171
if (theTarget.tagName.toLowerCase() !== "a" && theTarget.parentNode) return checkAnchorClick(e, theTarget.parentNode); //let's try the parent (recursive)
11671172
//anchors

0 commit comments

Comments
 (0)