mirror of
https://github.com/moodle/moodle.git
synced 2025-07-14 02:46:30 +02:00
MDL-51190 javascript: Make "maximised embed" compatible with MS Edge
MS Edge exhibits strange behaviour when M.util.init_maximised_embed hides the embedded document by setting its width and height to 0px. Toggling display:none instead achieves the intended goal without breaking Edge.
This commit is contained in:
@ -343,8 +343,7 @@ M.util.init_maximised_embed = function(Y, id) {
|
||||
};
|
||||
|
||||
var resize_object = function() {
|
||||
obj.setStyle('width', '0px');
|
||||
obj.setStyle('height', '0px');
|
||||
obj.setStyle('display', 'none');
|
||||
var newwidth = get_htmlelement_size('maincontent', 'width') - 35;
|
||||
|
||||
if (newwidth > 500) {
|
||||
@ -360,13 +359,16 @@ M.util.init_maximised_embed = function(Y, id) {
|
||||
newheight = 400;
|
||||
}
|
||||
obj.setStyle('height', newheight+'px');
|
||||
obj.setStyle('display', '');
|
||||
};
|
||||
|
||||
resize_object();
|
||||
// fix layout if window resized too
|
||||
window.onresize = function() {
|
||||
resize_object();
|
||||
};
|
||||
Y.use('event-resize', function (Y) {
|
||||
Y.on("windowresize", function() {
|
||||
resize_object();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user