impressive step click support

This commit is contained in:
Bartek Szopka
2012-01-04 23:42:50 +01:00
parent 67eb225ee1
commit 0edcf9021e
2 changed files with 13 additions and 7 deletions

View File

@@ -408,15 +408,16 @@ a:hover {
#overview {
z-index: -1;
padding: 0;
}
/* on overview step everything is visible */
#impress.step-overview .step {
opacity: 1;
cursor: pointer;
}
/*
* SLIDE STEP STYLES
*

View File

@@ -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 () {