removed click anywhere navigation
This commit is contained in:
parent
6bd6a98d37
commit
48e5348bde
1 changed files with 1 additions and 24 deletions
|
@ -119,29 +119,6 @@ function ComicBook(id, srcs, opts) {
|
||||||
location.hash = pageNo;
|
location.hash = pageNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Figure out the cursor position relative to the canvas.
|
|
||||||
*
|
|
||||||
* Thanks to: Mark Pilgrim & http://diveintohtml5.org/canvas.html
|
|
||||||
*/
|
|
||||||
function getCursorPosition(e) {
|
|
||||||
|
|
||||||
var x; // horizontal cursor position
|
|
||||||
|
|
||||||
// check if page relative positions exist, if not figure them out
|
|
||||||
if (e.pageX) {
|
|
||||||
x = e.pageX;
|
|
||||||
} else {
|
|
||||||
x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
|
|
||||||
}
|
|
||||||
|
|
||||||
// make the position relative to the canvas
|
|
||||||
x -= canvas.offsetLeft;
|
|
||||||
|
|
||||||
// check if the user clicked on the left or right side
|
|
||||||
return (x <= canvas.width / 2) ? 'left' : 'right';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup the canvas element for use throughout the class.
|
* Setup the canvas element for use throughout the class.
|
||||||
*
|
*
|
||||||
|
@ -708,7 +685,7 @@ function ComicBook(id, srcs, opts) {
|
||||||
|
|
||||||
switch (e.type) {
|
switch (e.type) {
|
||||||
case "click":
|
case "click":
|
||||||
side = getCursorPosition(e);
|
ComicBook.prototype.toggleToolbar();
|
||||||
break;
|
break;
|
||||||
case "keydown":
|
case "keydown":
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue