Skip to content

Commit

Permalink
MDL-64640 feedback: Fix target link on deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
Garrett Boone authored and andrewnicols committed Jan 27, 2019
1 parent 5280442 commit bc3ba91
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mod/feedback/amd/build/edit.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions mod/feedback/amd/src/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function($, ajax, str, notification) {
var manager = {
deleteItem: function(e) {
e.preventDefault();
var targetUrl = $(e.currentTarget).attr('href');

str.get_strings([
{
Expand All @@ -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() {
Expand Down

0 comments on commit bc3ba91

Please sign in to comment.