Hi All,
I'm looking to use the Modal Factory as per https://docs.moodle.org/dev/AMD_Modal
However I'm struggling to get example 1 to actually work.
I've included it in the columns2.mustache file:
{{> theme_boost/head }}
{{#js}}
define(['jquery', 'core/modal_factory'], function($, ModalFactory) {
var trigger = $("#modal-0");
ModalFactory.create({
title: 'test title',
body: '<p>test body content</p>',
footer: 'test footer content',
}, trigger)
.done(function(modal) {
// Do what you want with your new modal.
});
});
//The code below works
$("#modal-0").click(function(){
alert("The paragraph was clicked.");
});
{{/js}}
The simple .click function works but the Modal doesn't. What am I missing please?
Cheers
Dave