Commit 88f56114 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

When configuring blocks, try to hide embedded media in text blocks that might...

When configuring blocks, try to hide embedded media in text blocks that might overlap with the configure form
Signed-off-by: default avatarRichard Mansfield <>
parent e62ea935
......@@ -298,7 +298,23 @@ function ViewManager() {
var d = getElementDimensions(e);
setStyle(e, {'height': d.h+'px'});
hideElement(getFirstElementByTagAndClassName(null, 'mediaplayer', e));
forEach(getElementsByTagAndClassName('object', null, e), function(o) {
addElementClass(o, 'in-mediaplayer');
// Try to find and hide players floating around in text blocks, etc. by looking for object elements
forEach(getElementsByTagAndClassName('object', null, cols), function (e) {
if (!hasElementClass(e, 'in-mediaplayer')) {
var d = getElementDimensions(e);
var temp = DIV({'class': 'hidden mediaplayer-placeholder'});
setStyle(temp, {'height': d.h+'px'});
insertSiblingNodesAfter(e, temp);
addElementClass(e, 'hidden');
removeElementClass(temp, 'hidden');
insertSiblingNodesBefore(document.body.firstChild, DIV({'id': 'overlay'}));
......@@ -312,6 +328,11 @@ function ViewManager() {
showElement(getFirstElementByTagAndClassName(null, 'mediaplayer', e));
setStyle(e, {'height': 'auto'});
forEach(getElementsByTagAndClassName(null, 'mediaplayer-placeholder', cols), function (e) {
addElementClass(e, 'hidden');
removeElementClass(e.previousSibling, 'hidden');
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment