impressive step click support
This commit is contained in:
@@ -284,21 +284,26 @@
|
||||
|
||||
document.addEventListener("click", function ( event ) {
|
||||
// event delegation with "bubbling"
|
||||
// check if event target (or any of its parents it a link)
|
||||
// check if event target (or any of its parents is a link or a step)
|
||||
var target = event.target;
|
||||
while ( (target.tagName != "A") && (target != document.body) ) {
|
||||
while ( (target.tagName != "A") &&
|
||||
(!target.stepData) &&
|
||||
(target != document.body) ) {
|
||||
target = target.parentNode;
|
||||
}
|
||||
|
||||
if ( target.tagName == "A" ) {
|
||||
var href = target.getAttribute("href");
|
||||
|
||||
// if it's a link to presentation step, select this step
|
||||
if ( href && href[0] == '#' && ( target = byId(href.slice(1)) ) ) {
|
||||
select(target);
|
||||
event.preventDefault();
|
||||
// if it's a link to presentation step, target this step
|
||||
if ( href && href[0] == '#' ) {
|
||||
target = byId( href.slice(1) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( select(target) ) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
var getElementFromUrl = function () {
|
||||
|
||||
Reference in New Issue
Block a user