diff --git a/mod/feedback/amd/build/edit.min.js b/mod/feedback/amd/build/edit.min.js index b8a70958e65..ab86db4ac38 100644 --- a/mod/feedback/amd/build/edit.min.js +++ b/mod/feedback/amd/build/edit.min.js @@ -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}}); \ No newline at end of file +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}}); \ No newline at end of file diff --git a/mod/feedback/amd/src/edit.js b/mod/feedback/amd/src/edit.js index d985a47f750..2ee0fd4fe25 100644 --- a/mod/feedback/amd/src/edit.js +++ b/mod/feedback/amd/src/edit.js @@ -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() {