Commit 9e81132d authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic

Bug 1813987: resizing wall/gallery block when content change

wall
- resize the block when adding a new post
- resize the block when the tinymce is changed
(menu expanded/textarea resized)

image gallery
- resize the block when the block has a slide show
and the image is changed

behatnotneeded

Change-Id: I7fe0624285443b6173d9bd5f5be488539f6da03d
parent 6f2f9f8f
......@@ -70,6 +70,12 @@ class PluginBlocktypeGallery extends MaharaCoreBlocktype {
array(
'file' => get_config('wwwroot') . 'js/masonry/masonry.min.js',
'initjs' => " $('.js-masonry.thumbnails').masonry({ itemSelector: '.thumb' });"
),
array(
'file' => '',
'initjs' => "$('#slideshow{$blockid}').on('slid.bs.carousel', function () {
$(window).trigger('colresize');
});"
)
);
}
......
......@@ -214,11 +214,20 @@ function wallpost_success(form, data) {
}
}
formSuccess(form, data);
$(window).trigger('colresize');
}
}
jQuery( function() {
// needs to initialize the tinyMCE editor when the block is loaded
PieformManager.signal('onload');
if (typeof(tinyMCE) != 'undefined') {
tinyMCE.activeEditor.on('ResizeEditor', function(e) {
$(window).trigger('colresize');
});
tinyMCE.activeEditor.on('init', function(e) {
$(window).trigger('colresize');
});
}
});
EOF;
return "<script>$js</script>";
......
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