MDL-35836 Rewrite doctonewwindow handling to use delegation instead of individual events

This commit is contained in:
Andrew Robert Nicols 2012-10-07 09:55:08 +01:00
parent 7e8ae12a7a
commit afe3566cca
4 changed files with 44 additions and 34 deletions

View file

@ -34,36 +34,6 @@ YUI.add('moodle-course-modchooser', function(Y) {
// Catch the page toggle
Y.all('.block_settings #settingsnav .type_course .modchoosertoggle a').on('click', this.toggle_mod_chooser, this);
// Ensure that help links are opened in an appropriate popup
this.container.all('div.helpdoclink a').on('click', function(e) {
var anchor = e.target.ancestor('a', true);
var args = {
'name' : 'popup',
'url' : anchor.getAttribute('href'),
'option' : ''
};
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(',');
// Note: openpopup is provided by lib/javascript-static.js
openpopup(e, args);
});
},
/**
* Update any section areas within the scope of the specified