Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
shower-presentation
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Шардт Максим Александрович
shower-presentation
Commits
1ee464f5
Commit
1ee464f5
authored
Nov 08, 2013
by
Vadim Makeev
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #156 from anton-ryzhov/event_handlers
Don't call iterate DOM several times in event handlers
parents
34ac2127
79f12125
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
shower.js
shower.js
+10
-6
No files found.
shower.js
View file @
1ee464f5
...
...
@@ -42,7 +42,7 @@ window.shower = window.shower || (function(window, document, undefined) {
},
isLast
:
function
()
{
return
shower
.
slideList
.
length
===
this
.
number
+
1
return
shower
.
slideList
.
length
===
this
.
number
+
1
;
},
/**
...
...
@@ -889,11 +889,13 @@ window.shower = window.shower || (function(window, document, undefined) {
shower
.
init
();
document
.
addEventListener
(
'click'
,
function
(
e
)
{
var
slideNumber
=
shower
.
getSlideNumber
(
shower
.
_getSlideIdByEl
(
e
.
target
)),
var
slideId
=
shower
.
_getSlideIdByEl
(
e
.
target
),
slideNumber
,
slide
;
// Click on slide in List mode
if
(
shower
.
isListMode
()
&&
shower
.
_getSlideIdByEl
(
e
.
target
))
{
if
(
slideId
&&
shower
.
isListMode
())
{
slideNumber
=
shower
.
getSlideNumber
(
slideId
);
// Warning: go must be before enterSlideMode.
// Otherwise there is a bug in Chrome
shower
.
go
(
slideNumber
);
...
...
@@ -908,11 +910,12 @@ window.shower = window.shower || (function(window, document, undefined) {
},
false
);
document
.
addEventListener
(
'touchstart'
,
function
(
e
)
{
var
slideNumber
=
shower
.
getSlideNumber
(
shower
.
_getSlideIdByEl
(
e
.
target
)),
var
slideId
=
shower
.
_getSlideIdByEl
(
e
.
target
),
slideNumber
,
slide
,
x
;
if
(
s
hower
.
_getSlideIdByEl
(
e
.
target
)
)
{
if
(
s
lideId
)
{
if
(
shower
.
isSlideMode
()
&&
!
shower
.
_checkInteractiveElement
(
e
))
{
x
=
e
.
touches
[
0
].
pageX
;
...
...
@@ -924,9 +927,10 @@ window.shower = window.shower || (function(window, document, undefined) {
}
if
(
shower
.
isListMode
())
{
slideNumber
=
shower
.
getSlideNumber
(
slideId
);
// Warning: go must be before enterSlideMode.
// Otherwise there is a bug in Chrome
shower
.
go
(
s
hower
.
getSlideNumber
(
shower
.
_getSlideIdByEl
(
e
.
target
))
);
shower
.
go
(
s
lideNumber
);
shower
.
enterSlideMode
();
shower
.
showPresenterNotes
(
slideNumber
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment