Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-theme_boost_campus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle-theme_boost_campus
Commits
ed76e404
Commit
ed76e404
authored
7 years ago
by
Kathrin Osswald
Browse files
Options
Downloads
Patches
Plain Diff
Improved catching shortcuts feature again to prevent catching when editable content is focused.
parent
20534c43
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGES.md
+4
-0
4 additions, 0 deletions
CHANGES.md
amd/build/catchshortcuts.min.js
+1
-1
1 addition, 1 deletion
amd/build/catchshortcuts.min.js
amd/src/catchshortcuts.js
+3
-3
3 additions, 3 deletions
amd/src/catchshortcuts.js
with
8 additions
and
4 deletions
CHANGES.md
+
4
−
0
View file @
ed76e404
...
@@ -4,6 +4,10 @@ moodle-theme_boost_campus
...
@@ -4,6 +4,10 @@ moodle-theme_boost_campus
Changes
Changes
-------
-------
### Unreleased
*
2017-10-16 - Improved catching shortcuts feature again to prevent catching when editable content is focused.
### Release v3.2-r4
### Release v3.2-r4
*
2017-09-25 - Improved catching shortcuts feature to prevent the catching when form elements are focused.
*
2017-09-25 - Improved catching shortcuts feature to prevent the catching when form elements are focused.
...
...
This diff is collapsed.
Click to expand it.
amd/build/catchshortcuts.min.js
+
1
−
1
View file @
ed76e404
define
([
"
jquery
"
],
function
(
a
){
"
use strict
"
;
function
b
(
b
){
"
end
"
==
b
&&
a
(
document
).
keydown
(
function
(
a
){
35
==
a
.
keyCode
&&
1
!=
d
()
&&
c
(
a
)}),
navigator
.
appVersion
.
indexOf
(
"
Mac
"
)
!=-
1
&&
"
cmdarrowdown
"
==
b
&&
a
(
document
).
keydown
(
function
(
a
){
40
==
a
.
keyCode
&&
a
.
metaKey
&&
1
!=
d
()
&&
c
(
a
)}),
navigator
.
appVersion
.
indexOf
(
"
Win
"
)
!=-
1
&&
"
ctrlarrowdown
"
==
b
&&
a
(
document
).
keydown
(
function
(
a
){
40
==
a
.
keyCode
&&
a
.
ctrlKey
&&
1
!=
d
()
&&
c
(
a
)})}
function
c
(
b
){
b
.
preventDefault
(),
a
(
"
html, body
"
).
animate
({
scrollTop
:
a
(
"
#page-footer
"
).
offset
().
top
-
a
(
window
).
height
()
+
50
},
500
)}
function
d
(){
var
a
=
document
.
activeElement
.
tagName
,
b
=!
1
;
return
"
INPUT
"
!=
a
&&
"
TEXTAREA
"
!=
a
||
(
b
=!
0
),
b
}
return
{
init
:
function
(
a
){
for
(
var
c
=
0
,
d
=
a
.
length
;
c
<
d
;
c
++
)
b
(
a
[
c
])}}});
define
([
"
jquery
"
],
function
(
a
){
"
use strict
"
;
function
b
(
b
){
"
end
"
==
b
&&
a
(
document
).
keydown
(
function
(
a
){
35
==
a
.
keyCode
&&
1
!=
d
()
&&
c
(
a
)}),
navigator
.
appVersion
.
indexOf
(
"
Mac
"
)
!=-
1
&&
"
cmdarrowdown
"
==
b
&&
a
(
document
).
keydown
(
function
(
a
){
40
==
a
.
keyCode
&&
a
.
metaKey
&&
1
!=
d
()
&&
c
(
a
)}),
navigator
.
appVersion
.
indexOf
(
"
Win
"
)
!=-
1
&&
"
ctrlarrowdown
"
==
b
&&
a
(
document
).
keydown
(
function
(
a
){
40
==
a
.
keyCode
&&
a
.
ctrlKey
&&
1
!=
d
()
&&
c
(
a
)})}
function
c
(
b
){
b
.
preventDefault
(),
a
(
"
html, body
"
).
animate
({
scrollTop
:
a
(
"
#page-footer
"
).
offset
().
top
-
a
(
window
).
height
()
+
50
},
500
)}
function
d
(){
var
a
=
document
.
activeElement
,
b
=!
1
;
return
"
INPUT
"
!=
a
.
tagName
&&
"
TEXTAREA
"
!=
a
.
tagName
&&
1
!=
a
.
isContentEditable
||
(
b
=!
0
),
b
}
return
{
init
:
function
(
a
){
for
(
var
c
=
0
,
d
=
a
.
length
;
c
<
d
;
c
++
)
b
(
a
[
c
])}}});
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
amd/src/catchshortcuts.js
+
3
−
3
View file @
ed76e404
...
@@ -91,10 +91,10 @@ define(['jquery'], function($) {
...
@@ -91,10 +91,10 @@ define(['jquery'], function($) {
*/
*/
function
checkForActiveFormElement
()
{
function
checkForActiveFormElement
()
{
// Get the active Element for the current page.
// Get the active Element for the current page.
var
activeElement
=
document
.
activeElement
.
tagName
;
var
activeElement
=
document
.
activeElement
;
var
returnvalue
=
false
;
var
returnvalue
=
false
;
// Check if the given active element is
an
input field
or a textarea
.
// Check if the given active element is
type of
input field
, textarea or editable content
.
if
(
activeElement
==
'
INPUT
'
||
activeElement
==
'
TEXTAREA
'
)
{
if
(
activeElement
.
tagName
==
'
INPUT
'
||
activeElement
.
tagName
==
'
TEXTAREA
'
||
activeElement
.
isContentEditable
==
true
)
{
returnvalue
=
true
;
returnvalue
=
true
;
}
}
return
returnvalue
;
return
returnvalue
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment