Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
my-cucumbers-ru-github-io
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
Лотуга Данила Сергеевич
my-cucumbers-ru-github-io
Commits
e6833d5f
Commit
e6833d5f
authored
Feb 12, 2013
by
miripiruni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #99: Inner navigation should be also controlled by slide timing
parent
310f5d74
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
13 deletions
+33
-13
shower.js
shower.js
+33
-13
No files found.
shower.js
View file @
e6833d5f
...
@@ -48,7 +48,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -48,7 +48,7 @@ window.shower = (function(window, document, undefined) {
id
:
slides
[
i
].
id
,
id
:
slides
[
i
].
id
,
hasInnerNavigation
:
null
!==
slides
[
i
].
querySelector
(
'.next'
),
hasInnerNavigation
:
null
!==
slides
[
i
].
querySelector
(
'.next'
),
timing
:
timing
,
timing
:
timing
,
innerLength
:
slides
[
i
].
querySelectorAll
(
'.next'
).
length
,
innerLength
:
slides
[
i
].
querySelectorAll
(
'.next'
).
length
+
1
,
innerComplete
:
0
innerComplete
:
0
});
});
}
}
...
@@ -550,29 +550,46 @@ window.shower = (function(window, document, undefined) {
...
@@ -550,29 +550,46 @@ window.shower = (function(window, document, undefined) {
var
slide
;
var
slide
;
slideNumber
=
shower
.
_normalizeSlideNumber
(
slideNumber
);
slideNumber
=
shower
.
_normalizeSlideNumber
(
slideNumber
);
slide
=
slideList
[
slideNumber
];
if
(
!
shower
.
_isNumber
(
slideNumber
))
{
if
(
!
shower
.
_isNumber
(
slideNumber
))
{
throw
new
Error
(
'Gimme slide number as Number, baby!'
);
throw
new
Error
(
'Gimme slide number as Number, baby!'
);
}
}
slide
=
slideList
[
slideNumber
];
clearInterval
(
timer
);
clearInterval
(
timer
);
if
(
slide
&&
slide
.
timing
)
{
if
(
slide
&&
slide
.
timing
)
{
timer
=
setInterval
(
function
()
{
// Inner Navigation not finished
// Inner Navigation already finished
if
(
slide
.
innerLength
>=
slide
.
innerComplete
)
{
if
(
slide
.
innerLength
===
slide
.
innerComplete
)
{
shower
.
increaseInnerNavigation
(
slideNumber
);
timer
=
setInterval
(
function
()
{
slide
.
innerComplete
++
;
}
else
{
clearInterval
(
timer
);
clearInterval
(
timer
);
// Check if last slide
// Check if last slide
if
(
slideList
.
length
!==
slideNumber
+
1
)
{
if
(
slideList
.
length
!==
slideNumber
+
1
)
{
shower
.
next
();
shower
.
next
();
}
}
}
},
},
slide
.
timing
*
slide
.
innerLength
);
slide
.
timing
);
}
else
{
timer
=
setInterval
(
function
()
{
// Inner Navigation not finished
if
(
slide
.
innerLength
>
slide
.
innerComplete
)
{
shower
.
increaseInnerNavigation
(
slideNumber
);
slide
.
innerComplete
++
;
}
// Inner Navigation already finished
if
(
slide
.
innerLength
===
slide
.
innerComplete
)
{
clearInterval
(
timer
);
// Check if last slide
if
(
slideList
.
length
!==
slideNumber
+
1
)
{
shower
.
next
();
}
}
},
slide
.
timing
);
}
}
}
return
true
;
return
true
;
...
@@ -629,11 +646,14 @@ window.shower = (function(window, document, undefined) {
...
@@ -629,11 +646,14 @@ window.shower = (function(window, document, undefined) {
},
false
);
},
false
);
document
.
addEventListener
(
'keydown'
,
function
(
e
)
{
document
.
addEventListener
(
'keydown'
,
function
(
e
)
{
var
currentSlideNumber
,
isInnerNavCompleted
;
// Shortcut for alt, ctrl and meta keys
// Shortcut for alt, ctrl and meta keys
if
(
e
.
altKey
||
e
.
ctrlKey
||
e
.
metaKey
)
{
return
;
}
if
(
e
.
altKey
||
e
.
ctrlKey
||
e
.
metaKey
)
{
return
;
}
var
currentSlideNumber
=
shower
.
getCurrentSlideNumber
(),
currentSlideNumber
=
shower
.
getCurrentSlideNumber
(),
isInnerNavCompleted
=
true
;
isInnerNavCompleted
=
true
;
switch
(
e
.
which
)
{
switch
(
e
.
which
)
{
case
116
:
// F5
case
116
:
// F5
...
...
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