Commit 6fb84258 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1906383: Use of Image Gallery block means Copy page unavailable"

parents fb029b5d a5bbfc50
......@@ -72,9 +72,11 @@ class PluginBlocktypeGallery extends MaharaCoreBlocktype {
'initjs' => " $('.js-masonry.thumbnails').masonry({ itemSelector: '.thumb' });"
),
array(
'file' => get_config('wwwroot') . 'lib/bootstrap/assets/javascripts/bootstrap.min.js',
'initjs' => "$('#slideshow{$blockid}').on('slid.bs.carousel', function () {
$(window).trigger('colresize');
'file' => '',
'initjs' => "$(function() {
$('#slideshow{$blockid}').on('slid.bs.carousel', function () {
$(window).trigger('colresize');
});
});"
)
);
......
......@@ -2717,7 +2717,9 @@ class View {
);
foreach($instancejs as $jsfile) {
if (is_array($jsfile) && isset($jsfile['file'])) {
$javascriptfiles[] = $this->add_blocktype_path($blockinstance, $jsfile['file']);
if (!empty($jsfile['file'])) {
$javascriptfiles[] = $this->add_blocktype_path($blockinstance, $jsfile['file']);
}
if (isset($jsfile['initjs'])) {
$initjavascripts[] = $jsfile['initjs'];
}
......@@ -2727,8 +2729,8 @@ class View {
}
}
}
else if (is_string($jsfile)) {
$javascriptfiles[] = $this->add_blocktype_path($blockinstance, $jsfile);;
else if (is_string($jsfile) && !empty($jstring)) {
$javascriptfiles[] = $this->add_blocktype_path($blockinstance, $jsfile);
}
}
// Check to see if we need to include the block Ajax file.
......
Supports Markdown
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