MDL-44085 course: Replace JS confirm() by YUI confirm
This commit is contained in:
committed by
Sam Hemelryk
parent
c10affa57b
commit
0807908f17
+22
-15
@@ -478,22 +478,29 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
|
||||
confirmstring = M.util.get_string('deletechecktype', 'moodle', plugindata);
|
||||
}
|
||||
|
||||
// Confirm element removal
|
||||
if (!confirm(confirmstring)) {
|
||||
return this;
|
||||
}
|
||||
// Create the confirmation dialogue.
|
||||
var confirm = new M.core.confirm({
|
||||
question: confirmstring,
|
||||
modal: true
|
||||
});
|
||||
|
||||
// If it is confirmed.
|
||||
confirm.on('complete-yes', function() {
|
||||
|
||||
// Actually remove the element.
|
||||
element.remove();
|
||||
var data = {
|
||||
'class': 'resource',
|
||||
'action': 'DELETE',
|
||||
'id': Y.Moodle.core_course.util.cm.getId(element)
|
||||
};
|
||||
this.send_request(data);
|
||||
if (M.core.actionmenu && M.core.actionmenu.instance) {
|
||||
M.core.actionmenu.instance.hideMenu();
|
||||
}
|
||||
|
||||
}, this);
|
||||
|
||||
// Actually remove the element
|
||||
element.remove();
|
||||
var data = {
|
||||
'class': 'resource',
|
||||
'action': 'DELETE',
|
||||
'id': Y.Moodle.core_course.util.cm.getId(element)
|
||||
};
|
||||
this.send_request(data);
|
||||
if (M.core.actionmenu && M.core.actionmenu.instance) {
|
||||
M.core.actionmenu.instance.hideMenu();
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -478,22 +478,29 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
|
||||
confirmstring = M.util.get_string('deletechecktype', 'moodle', plugindata);
|
||||
}
|
||||
|
||||
// Confirm element removal
|
||||
if (!confirm(confirmstring)) {
|
||||
return this;
|
||||
}
|
||||
// Create the confirmation dialogue.
|
||||
var confirm = new M.core.confirm({
|
||||
question: confirmstring,
|
||||
modal: true
|
||||
});
|
||||
|
||||
// If it is confirmed.
|
||||
confirm.on('complete-yes', function() {
|
||||
|
||||
// Actually remove the element.
|
||||
element.remove();
|
||||
var data = {
|
||||
'class': 'resource',
|
||||
'action': 'DELETE',
|
||||
'id': Y.Moodle.core_course.util.cm.getId(element)
|
||||
};
|
||||
this.send_request(data);
|
||||
if (M.core.actionmenu && M.core.actionmenu.instance) {
|
||||
M.core.actionmenu.instance.hideMenu();
|
||||
}
|
||||
|
||||
}, this);
|
||||
|
||||
// Actually remove the element
|
||||
element.remove();
|
||||
var data = {
|
||||
'class': 'resource',
|
||||
'action': 'DELETE',
|
||||
'id': Y.Moodle.core_course.util.cm.getId(element)
|
||||
};
|
||||
this.send_request(data);
|
||||
if (M.core.actionmenu && M.core.actionmenu.instance) {
|
||||
M.core.actionmenu.instance.hideMenu();
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
|
||||
+22
-15
@@ -274,22 +274,29 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
|
||||
confirmstring = M.util.get_string('deletechecktype', 'moodle', plugindata);
|
||||
}
|
||||
|
||||
// Confirm element removal
|
||||
if (!confirm(confirmstring)) {
|
||||
return this;
|
||||
}
|
||||
// Create the confirmation dialogue.
|
||||
var confirm = new M.core.confirm({
|
||||
question: confirmstring,
|
||||
modal: true
|
||||
});
|
||||
|
||||
// If it is confirmed.
|
||||
confirm.on('complete-yes', function() {
|
||||
|
||||
// Actually remove the element.
|
||||
element.remove();
|
||||
var data = {
|
||||
'class': 'resource',
|
||||
'action': 'DELETE',
|
||||
'id': Y.Moodle.core_course.util.cm.getId(element)
|
||||
};
|
||||
this.send_request(data);
|
||||
if (M.core.actionmenu && M.core.actionmenu.instance) {
|
||||
M.core.actionmenu.instance.hideMenu();
|
||||
}
|
||||
|
||||
}, this);
|
||||
|
||||
// Actually remove the element
|
||||
element.remove();
|
||||
var data = {
|
||||
'class': 'resource',
|
||||
'action': 'DELETE',
|
||||
'id': Y.Moodle.core_course.util.cm.getId(element)
|
||||
};
|
||||
this.send_request(data);
|
||||
if (M.core.actionmenu && M.core.actionmenu.instance) {
|
||||
M.core.actionmenu.instance.hideMenu();
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user