MDL-64640 feedback: Fix target link on deletion
authorGarrett Boone <webadmin@emergy.org>
Sun, 27 Jan 2019 10:11:28 +0000 (18:11 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Sun, 27 Jan 2019 10:12:42 +0000 (18:12 +0800)
mod/feedback/amd/build/edit.min.js
mod/feedback/amd/src/edit.js

index b8a7095..ab86db4 100644 (file)
Binary files a/mod/feedback/amd/build/edit.min.js and b/mod/feedback/amd/build/edit.min.js differ
index d985a47..2ee0fd4 100644 (file)
@@ -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() {