Commit a5bbfc50 authored by Lisa Seeto's avatar Lisa Seeto
Browse files

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



 - change the way that the js script for slideshow is called
   eliminating the need for bootstrap to be included a second time
   (error was because bootstrap was included without popper.js first,
    but it turns out bootstrap didn't have to be included at all)

Change-Id: I3cb530d892105027c9ace08dded0a3717a571834
Signed-off-by: default avatarLisa Seeto <lisaseeto@catalyst.net.nz>
parent de54a39d
......@@ -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.
......
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