mirror of
https://github.com/moodle/moodle.git
synced 2025-07-25 00:02:18 +02:00
MDL-35836 Rewrite doctonewwindow handling to use delegation instead of individual events
This commit is contained in:
@@ -1403,6 +1403,42 @@ function hide_item(itemid) {
|
||||
}
|
||||
}
|
||||
|
||||
M.util.help_popups = {
|
||||
setup : function(Y) {
|
||||
Y.one('body').delegate('click', this.open_popup, 'a.helplinkpopup', this);
|
||||
},
|
||||
open_popup : function(e) {
|
||||
// Prevent the default page action
|
||||
e.preventDefault();
|
||||
|
||||
// Grab the anchor that was clicked
|
||||
var anchor = e.target.ancestor('a', true);
|
||||
var args = {
|
||||
'name' : 'popup',
|
||||
'url' : anchor.getAttribute('href'),
|
||||
'options' : ''
|
||||
};
|
||||
var options = [
|
||||
'height=600',
|
||||
'width=800',
|
||||
'top=0',
|
||||
'left=0',
|
||||
'menubar=0',
|
||||
'location=0',
|
||||
'scrollbars',
|
||||
'resizable',
|
||||
'toolbar',
|
||||
'status',
|
||||
'directories=0',
|
||||
'fullscreen=0',
|
||||
'dependent'
|
||||
]
|
||||
args.options = options.join(',');
|
||||
|
||||
openpopup(e, args);
|
||||
}
|
||||
}
|
||||
|
||||
M.util.help_icon = {
|
||||
Y : null,
|
||||
instance : null,
|
||||
|
Reference in New Issue
Block a user