Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Andrew Seales
Kubernetes Presentation
Commits
8524af73
Commit
8524af73
authored
Dec 10, 2014
by
Hakim El Hattab
Browse files
zoom plugin now works for scaled presentations
parent
dc215a24
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugin/zoom-js/zoom.js
View file @
8524af73
...
...
@@ -5,9 +5,21 @@
document
.
querySelector
(
'
.reveal
'
).
addEventListener
(
'
mousedown
'
,
function
(
event
)
{
var
modifier
=
(
Reveal
.
getConfig
().
zoomKey
?
Reveal
.
getConfig
().
zoomKey
:
'
alt
'
)
+
'
Key
'
;
var
zoomPadding
=
20
;
var
revealScale
=
Reveal
.
getScale
();
if
(
event
[
modifier
]
&&
isEnabled
)
{
event
.
preventDefault
();
zoom
.
to
({
element
:
event
.
target
,
pan
:
false
});
var
bounds
=
event
.
target
.
getBoundingClientRect
();
zoom
.
to
({
x
:
(
bounds
.
left
*
revealScale
)
-
zoomPadding
,
y
:
(
bounds
.
top
*
revealScale
)
-
zoomPadding
,
width
:
(
bounds
.
width
*
revealScale
)
+
(
zoomPadding
*
2
),
height
:
(
bounds
.
height
*
revealScale
)
+
(
zoomPadding
*
2
),
pan
:
false
});
}
}
);
...
...
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