Makes it possible to extend JS delete/toggle action
authorMatthias Schmidt <gravatronics@live.com>
Mon, 21 May 2012 07:24:35 +0000 (09:24 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 21 May 2012 07:24:35 +0000 (09:24 +0200)
This is very helpful when you want to have a different effect which is especially needed when dealing with nested lists and deleting a list item with children.

wcfsetup/install/files/js/WCF.js

index 93a9e3b3efac22a7e11a398d177723425f414584..b53e153749e7613900edf84cc8560bf3b08b21de 100644 (file)
@@ -1432,8 +1432,7 @@ WCF.Action.SimpleProxy.prototype = {
  * @param      jQuery          containerList
  * @param      jQuery          badgeList
  */
-WCF.Action.Delete = function(className, containerList, badgeList) { this.init(className, containerList, badgeList); };
-WCF.Action.Delete.prototype = {
+WCF.Action.Delete = Class.extend({
        /**
         * Initializes 'delete'-Proxy.
         * 
@@ -1534,7 +1533,7 @@ WCF.Action.Delete.prototype = {
                        }
                }, this));
        }
-};
+});
 
 /**
  * Basic implementation for AJAXProxy-based toggle actions.
@@ -1543,8 +1542,7 @@ WCF.Action.Delete.prototype = {
  * @param      jQuery          containerList
  * @param      string          toggleButtonSelector
  */
-WCF.Action.Toggle = function(className, containerList, toggleButtonSelector) { this.init(className, containerList, toggleButtonSelector); };
-WCF.Action.Toggle.prototype = {
+WCF.Action.Toggle = Class.extend({
        /**
         * Initializes 'toggle'-Proxy
         * 
@@ -1643,7 +1641,7 @@ WCF.Action.Toggle.prototype = {
                        }
                }, this));
        }
-};
+});
 
 /**
  * Executes provided callback if scroll threshold is reached. Usuable to determine