forked from davidherney/moodle-format_onetopic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
format.js
38 lines (28 loc) · 965 Bytes
/
format.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Javascript functions for onetopic course format
M.course = M.course || {};
M.course.format = M.course.format || {};
M.course.format.showInfo = function(id) {
new M.core.dialogue({
draggable: true,
headerContent: '<span>' + M.util.get_string('info', 'moodle') + '</span>',
bodyContent: Y.Node.one('#' + id),
centered: true,
width: '480px',
modal: true,
visible: true
});
Y.Node.one('#' + id).show();
};
M.course.format.dialogueinitloaded = false;
M.course.format.dialogueinit = function() {
if (M.course.format.dialogueinitloaded) {
return;
}
M.course.format.dialogueinitloaded = true;
Y.all('[data-infoid]').each(function(node) {
node.on('click', function(e) {
e.preventDefault();
M.course.format.showInfo(node.getAttribute('data-infoid'));
});
});
};