mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-35836 Rewrite doctonewwindow handling to use delegation instead of individual events
This commit is contained in:
parent
7e8ae12a7a
commit
afe3566cca
4 changed files with 44 additions and 34 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue