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
cfa2c542
Commit
cfa2c542
authored
Jul 18, 2011
by
Vadim Makeev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better Enter key handling
parent
df0c517b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
script.js
scripts/script.js
+11
-6
No files found.
scripts/script.js
View file @
cfa2c542
...
...
@@ -53,9 +53,6 @@
case
32
:
// Space
current
+=
e
.
shiftKey
?
-
1
:
1
;
break
;
case
13
:
// Enter
if
(
!
current
+
1
)
enterFull
();
break
;
default
:
prevent
=
false
;
}
...
...
@@ -79,7 +76,13 @@
updateProgress
();
if
(
!
isFull
())
history
.
pushState
(
null
,
null
,
url
.
pathname
+
'?full'
+
url
.
hash
);
window
.
addEventListener
(
'resize'
,
resizeFull
,
false
);
document
.
addEventListener
(
'keydown'
,
exitFullEsc
,
false
);
document
.
addEventListener
(
'keyup'
,
exitFullKey
,
false
);
document
.
removeEventListener
(
'keydown'
,
enterFullKey
,
false
);
}
function
enterFullKey
(
e
)
{
if
(
e
.
which
!=
13
)
return
;
enterFull
();
}
function
exitFull
()
{
...
...
@@ -89,10 +92,11 @@
history
.
pushState
(
null
,
null
,
url
.
pathname
.
replace
(
'?full'
,
''
));
url
.
hash
=
hash
;
window
.
removeEventListener
(
'resize'
,
resizeFull
,
false
);
document
.
removeEventListener
(
'keydown'
,
exitFullEsc
,
false
);
document
.
removeEventListener
(
'keyup'
,
exitFullKey
,
false
);
document
.
addEventListener
(
'keydown'
,
enterFullKey
,
false
);
}
function
exitFull
Esc
(
e
)
{
function
exitFull
Key
(
e
)
{
if
(
e
.
which
!=
27
)
return
;
exitFull
();
}
...
...
@@ -110,5 +114,6 @@
if
(
isFull
())
enterFull
();
},
false
);
document
.
addEventListener
(
'keydown'
,
turnSlide
,
false
);
document
.
addEventListener
(
'keydown'
,
enterFullKey
,
false
);
})();
\ No newline at end of file
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