mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-64640 feedback: Fix target link on deletion
This commit is contained in:
parent
1717604fa0
commit
00a11f40f2
2
mod/feedback/amd/build/edit.min.js
vendored
2
mod/feedback/amd/build/edit.min.js
vendored
@ -1 +1 @@
|
||||
define(["jquery","core/ajax","core/str","core/notification"],function(a,b,c,d){var e={deleteItem:function(b){b.preventDefault(),c.get_strings([{key:"confirmation",component:"admin"},{key:"confirmdeleteitem",component:"mod_feedback"},{key:"yes",component:"moodle"},{key:"no",component:"moodle"}]).done(function(c){d.confirm(c[0],c[1],c[2],c[3],a.proxy(function(){window.location=a(this).attr("href")},b.currentTarget))})},setup:function(){a("body").delegate('[data-action="delete"]',"click",e.deleteItem)}};return{setup:e.setup}});
|
||||
define(["jquery","core/ajax","core/str","core/notification"],function(a,b,c,d){var e={deleteItem:function(b){b.preventDefault();var e=a(b.currentTarget).attr("href");c.get_strings([{key:"confirmation",component:"admin"},{key:"confirmdeleteitem",component:"mod_feedback"},{key:"yes",component:"moodle"},{key:"no",component:"moodle"}]).then(function(a){d.confirm(a[0],a[1],a[2],a[3],function(){window.location=e})})["catch"]()},setup:function(){a("body").delegate('[data-action="delete"]',"click",e.deleteItem)}};return{setup:e.setup}});
|
@ -25,6 +25,7 @@ function($, ajax, str, notification) {
|
||||
var manager = {
|
||||
deleteItem: function(e) {
|
||||
e.preventDefault();
|
||||
var targetUrl = $(e.currentTarget).attr('href');
|
||||
|
||||
str.get_strings([
|
||||
{
|
||||
@ -43,11 +44,15 @@ function($, ajax, str, notification) {
|
||||
key: 'no',
|
||||
component: 'moodle'
|
||||
}
|
||||
]).done(function(s) {
|
||||
notification.confirm(s[0], s[1], s[2], s[3], $.proxy(function() {
|
||||
window.location = $(this).attr('href');
|
||||
}, e.currentTarget));
|
||||
});
|
||||
])
|
||||
.then(function(s) {
|
||||
notification.confirm(s[0], s[1], s[2], s[3], function() {
|
||||
window.location = targetUrl;
|
||||
});
|
||||
|
||||
return;
|
||||
})
|
||||
.catch();
|
||||
},
|
||||
|
||||
setup: function() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user