Using WCF.Action.Proxy.abortPrevious() in WCF.ACP.Worker
authorMagnus Kühn <magnus.khn@gmail.com>
Sat, 20 Apr 2013 07:40:40 +0000 (09:40 +0200)
committerMagnus Kühn <magnus.khn@gmail.com>
Sat, 20 Apr 2013 07:40:40 +0000 (09:40 +0200)
wcfsetup/install/files/acp/js/WCF.ACP.js

index a18154698334ad4111e1ec747d4ea2be730bf0a8..8d401836480fbf25f56d3d031803b20ccc7c6eef 100644 (file)
@@ -1126,12 +1126,6 @@ WCF.ACP.Options.Group = Class.extend({
  * @param      object          options
  */
 WCF.ACP.Worker = Class.extend({
-       /**
-        * true, if worker was aborted
-        * @var boolean
-        */
-       _aborted: false,
-       
        /**
         * dialog id
         * @var string
@@ -1165,7 +1159,6 @@ WCF.ACP.Worker = Class.extend({
         * @param       object          parameters
         */
        init: function(dialogID, className, title, parameters) {
-               this._aborted = false;
                this._dialogID = dialogID + 'Worker';
                this._dialog = null;
                this._proxy = new WCF.Action.Proxy({
@@ -1187,15 +1180,13 @@ WCF.ACP.Worker = Class.extend({
         * @param       object          data
         */
        _success: function(data) {
-               if (this._aborted) {
-                       return;
-               }
-               
                // init binding
                if (this._dialog === null) {
                        this._dialog = $('<div id="' + this._dialogID + '" />').hide().appendTo(document.body);
                        this._dialog.wcfDialog({
-                               onClose:  $.proxy(function() { this._aborted = true; }, this),
+                               onClose:  $.proxy(function() {
+                                       this._proxy.abortPrevious();
+                               }, this),
                                title: this._title
                        });
                }