Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
server
team-presentation
Commits
3d1d7683
Commit
3d1d7683
authored
Nov 09, 2017
by
Hakim El Hattab
Browse files
reconfiguring no longer unloads iframes on current slide
parent
376d140b
Changes
1
Hide whitespace changes
Inline
Side-by-side
js/reveal.js
View file @
3d1d7683
...
@@ -1274,6 +1274,8 @@
...
@@ -1274,6 +1274,8 @@
a
[
i
]
=
b
[
i
];
a
[
i
]
=
b
[
i
];
}
}
return
a
;
}
}
/**
/**
...
@@ -2509,7 +2511,7 @@
...
@@ -2509,7 +2511,7 @@
// Start or stop embedded content depending on global config
// Start or stop embedded content depending on global config
if
(
config
.
autoPlayMedia
===
false
)
{
if
(
config
.
autoPlayMedia
===
false
)
{
stopEmbeddedContent
(
currentSlide
);
stopEmbeddedContent
(
currentSlide
,
{
unloadIframes
:
false
}
);
}
}
else
{
else
{
startEmbeddedContent
(
currentSlide
);
startEmbeddedContent
(
currentSlide
);
...
@@ -3535,7 +3537,12 @@
...
@@ -3535,7 +3537,12 @@
*
*
* @param {HTMLElement} element
* @param {HTMLElement} element
*/
*/
function
stopEmbeddedContent
(
element
)
{
function
stopEmbeddedContent
(
element
,
options
)
{
options
=
extend
(
{
// Defaults
unloadIframes
:
true
},
options
||
{}
);
if
(
element
&&
element
.
parentNode
)
{
if
(
element
&&
element
.
parentNode
)
{
// HTML5 media elements
// HTML5 media elements
...
@@ -3566,13 +3573,15 @@
...
@@ -3566,13 +3573,15 @@
}
}
});
});
// Lazy loading iframes
if
(
options
.
unloadIframes
===
true
)
{
toArray
(
element
.
querySelectorAll
(
'
iframe[data-src]
'
)
).
forEach
(
function
(
el
)
{
// Unload lazy-loaded iframes
// Only removing the src doesn't actually unload the frame
toArray
(
element
.
querySelectorAll
(
'
iframe[data-src]
'
)
).
forEach
(
function
(
el
)
{
// in all browsers (Firefox) so we set it to blank first
// Only removing the src doesn't actually unload the frame
el
.
setAttribute
(
'
src
'
,
'
about:blank
'
);
// in all browsers (Firefox) so we set it to blank first
el
.
removeAttribute
(
'
src
'
);
el
.
setAttribute
(
'
src
'
,
'
about:blank
'
);
}
);
el
.
removeAttribute
(
'
src
'
);
}
);
}
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment