mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Merge branch 'MDL-24521' of git://github.com/samhemelryk/moodle
This commit is contained in:
commit
ff14fd71fd
1 changed files with 10 additions and 8 deletions
|
@ -262,15 +262,17 @@ M.util.show_confirm_dialog = function(e, args) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target.get('tagName').toLowerCase() == 'a') {
|
var targetancestor = null,
|
||||||
|
targetform = null;
|
||||||
|
|
||||||
|
if (target.test('a')) {
|
||||||
window.location = target.get('href');
|
window.location = target.get('href');
|
||||||
} else if (target.get('tagName').toLowerCase() == 'input') {
|
} else if ((targetancestor = target.ancestor('a')) !== null) {
|
||||||
var parentelement = target.get('parentNode');
|
window.location = targetancestor.get('href');
|
||||||
while (parentelement.get('tagName').toLowerCase() != 'form' && parentelement.get('tagName').toLowerCase() != 'body') {
|
} else if (target.test('input')) {
|
||||||
parentelement = parentelement.get('parentNode');
|
targetform = target.ancestor('form');
|
||||||
}
|
if (targetform && targetform.submit) {
|
||||||
if (parentelement.get('tagName').toLowerCase() == 'form') {
|
targetform.submit();
|
||||||
parentelement.submit();
|
|
||||||
}
|
}
|
||||||
} else if (M.cfg.developerdebug) {
|
} else if (M.cfg.developerdebug) {
|
||||||
alert("Element of type " + target.get('tagName') + " is not supported by the M.util.show_confirm_dialog function. Use A or INPUT");
|
alert("Element of type " + target.get('tagName') + " is not supported by the M.util.show_confirm_dialog function. Use A or INPUT");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue