This repository was archived by the owner on May 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathmodule1.js
More file actions
70 lines (62 loc) · 2.42 KB
/
Copy pathmodule1.js
File metadata and controls
70 lines (62 loc) · 2.42 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
M.show_forum_panel = {
init: function(Y, options) {
this.Y = Y;
this.spinnerpic = options.spinner;
this.mid = options.mid;
var showForumBtn = Y.one('#showForum');
showForumBtn.on('click', this.show_on_click);
},
show_on_click: function(e) {
M.show_forum_panel.showforumpanel();
},
showforumpanel: function() {
var Y = this.Y;
var url = M.cfg.wwwroot + "/blocks/fn_marking/forum_view.php?id=" + this.mid;
var div = Y.Node.create('</div><div/>');
div.set("id", "forumiframecontainer");
// Create iframe.
var ifrm = Y.Node.create('<iframe frameborder="0"><iframe>');
ifrm.set("src", url);
ifrm.set("name", "forumiframe");
ifrm.set("id", "forumiframe");
ifrm.setStyle('width', '100%');
ifrm.setStyle('height', '430px');
ifrm.setStyle('display', 'none');
div.append(ifrm);
Y.on('contentready', function(){
ifrm.setStyle('display', 'block');
}, '#forumiframe');
var panel;
panel = new Y.Panel({
bodyContent : div,
headerContent: 'Forum marking Area',
width : 950,
height : 500,
zIndex : 5,
xy : [300, -300],
centered : true,
modal : true,
visible : false,
render : true,
scroll : true,
focusOn : Y.one('#region-main-box'),
buttons: [{value : 'Close the panel',
section: 'footer',
action : function (e) {
e.preventDefault();
panel.hide();
window.location.reload();
}
},
{value : 'Close the panel',
section: 'header',
action : function (e) {
e.preventDefault();
panel.hide();
window.location.reload();
}
}]
});
panel.show();
}
}