diff --git a/admin/tool/usertours/amd/build/managesteps.min.js b/admin/tool/usertours/amd/build/managesteps.min.js index 886c25024b6..37718352d9f 100644 --- a/admin/tool/usertours/amd/build/managesteps.min.js +++ b/admin/tool/usertours/amd/build/managesteps.min.js @@ -1 +1 @@ -define(["jquery","core/str","core/notification"],function(a,b,c){var d={removeStep:function(d){d.preventDefault(),b.get_strings([{key:"confirmstepremovaltitle",component:"tool_usertours"},{key:"confirmstepremovalquestion",component:"tool_usertours"},{key:"yes",component:"moodle"},{key:"no",component:"moodle"}]).done(function(b){c.confirm(b[0],b[1],b[2],b[3],a.proxy(function(){window.location=a(this).attr("href")},d.currentTarget))})},setup:function(){a("body").delegate('[data-action="delete"]',"click",d.removeStep)}};return{setup:d.setup}}); \ No newline at end of file +define(["jquery","core/str","core/notification"],function(a,b,c){var d={removeStep:function(d){d.preventDefault();var e=a(d.currentTarget).attr("href");b.get_strings([{key:"confirmstepremovaltitle",component:"tool_usertours"},{key:"confirmstepremovalquestion",component:"tool_usertours"},{key:"yes",component:"moodle"},{key:"no",component:"moodle"}]).then(function(a){c.confirm(a[0],a[1],a[2],a[3],function(){window.location=e})})["catch"]()},setup:function(){a("body").delegate('[data-action="delete"]',"click",d.removeStep)}};return{setup:d.setup}}); \ No newline at end of file diff --git a/admin/tool/usertours/amd/build/managetours.min.js b/admin/tool/usertours/amd/build/managetours.min.js index 9c9e2e63298..75c7d1b5a43 100644 --- a/admin/tool/usertours/amd/build/managetours.min.js +++ b/admin/tool/usertours/amd/build/managetours.min.js @@ -1 +1 @@ -define(["jquery","core/ajax","core/str","core/notification"],function(a,b,c,d){var e={removeTour:function(b){b.preventDefault(),c.get_strings([{key:"confirmtourremovaltitle",component:"tool_usertours"},{key:"confirmtourremovalquestion",component:"tool_usertours"},{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.removeTour)}};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={removeTour:function(b){b.preventDefault();var e=a(b.currentTarget).attr("href");c.get_strings([{key:"confirmtourremovaltitle",component:"tool_usertours"},{key:"confirmtourremovalquestion",component:"tool_usertours"},{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.removeTour)}};return{setup:e.setup}}); \ No newline at end of file diff --git a/admin/tool/usertours/amd/src/managesteps.js b/admin/tool/usertours/amd/src/managesteps.js index ba520199ef3..420b89eea7b 100644 --- a/admin/tool/usertours/amd/src/managesteps.js +++ b/admin/tool/usertours/amd/src/managesteps.js @@ -18,6 +18,7 @@ function($, str, notification) { */ removeStep: function(e) { e.preventDefault(); + var targetUrl = $(e.currentTarget).attr('href'); str.get_strings([ { key: 'confirmstepremovaltitle', @@ -35,11 +36,15 @@ function($, 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(); }, /** diff --git a/admin/tool/usertours/amd/src/managetours.js b/admin/tool/usertours/amd/src/managetours.js index f5c601a54fa..f6d3237abae 100644 --- a/admin/tool/usertours/amd/src/managetours.js +++ b/admin/tool/usertours/amd/src/managetours.js @@ -18,7 +18,7 @@ function($, ajax, str, notification) { */ removeTour: function(e) { e.preventDefault(); - + var targetUrl = $(e.currentTarget).attr('href'); str.get_strings([ { key: 'confirmtourremovaltitle', @@ -36,11 +36,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(); }, /** 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() {