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 { #overview {
z-index: -1; z-index: -1;
padding: 0;
} }
/* on overview step everything is visible */ /* on overview step everything is visible */
#impress.step-overview .step { #impress.step-overview .step {
opacity: 1; opacity: 1;
cursor: pointer;
} }
/* /*
* SLIDE STEP STYLES * SLIDE STEP STYLES
* *

View File

@@ -284,21 +284,26 @@
document.addEventListener("click", function ( event ) { document.addEventListener("click", function ( event ) {
// event delegation with "bubbling" // 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; var target = event.target;
while ( (target.tagName != "A") && (target != document.body) ) { while ( (target.tagName != "A") &&
(!target.stepData) &&
(target != document.body) ) {
target = target.parentNode; target = target.parentNode;
} }
if ( target.tagName == "A" ) { if ( target.tagName == "A" ) {
var href = target.getAttribute("href"); var href = target.getAttribute("href");
// if it's a link to presentation step, select this step // if it's a link to presentation step, target this step
if ( href && href[0] == '#' && ( target = byId(href.slice(1)) ) ) { if ( href && href[0] == '#' ) {
select(target); target = byId( href.slice(1) );
event.preventDefault();
} }
} }
if ( select(target) ) {
event.preventDefault();
}
}); });
var getElementFromUrl = function () { var getElementFromUrl = function () {