X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..10a866c12701c0a0afd0ac85dcdcf32a421514ac:/src/widgets/Action.js?ds=inline
diff --git a/src/widgets/Action.js b/src/widgets/Action.js
index 6d28288e..f1c55997 100644
--- a/src/widgets/Action.js
+++ b/src/widgets/Action.js
@@ -1,5 +1,5 @@
/*!
- * Ext JS Library 3.0.0
+ * Ext JS Library 3.1.0
* Copyright(c) 2006-2009 Ext JS, LLC
* licensing@extjs.com
* http://www.extjs.com/license
@@ -57,13 +57,7 @@ aRef.setText('New text');
* @constructor
* @param {Object} config The configuration options
*/
-Ext.Action = function(config){
- this.initialConfig = config;
- this.itemId = config.itemId = (config.itemId || config.id || Ext.id());
- this.items = [];
-}
-
-Ext.Action.prototype = {
+Ext.Action = Ext.extend(Object, {
/**
* @cfg {String} text The text to set for all components using this action (defaults to '').
*/
@@ -96,9 +90,16 @@ Ext.Action.prototype = {
* See {@link Ext.Component}.{@link Ext.Component#itemId itemId}.
*/
/**
- * @cfg {Object} scope The scope in which the {@link #handler} function will execute.
+ * @cfg {Object} scope The scope (this reference) in which the
+ * {@link #handler}
is executed. Defaults to this Button.
*/
+ constructor : function(config){
+ this.initialConfig = config;
+ this.itemId = config.itemId = (config.itemId || config.id || Ext.id());
+ this.items = [];
+ },
+
// private
isAction : true,
@@ -198,10 +199,10 @@ Ext.Action.prototype = {
},
/**
- * Sets the function that will be called by each component using this action when its primary event is triggered.
+ * Sets the function that will be called by each Component using this action when its primary event is triggered.
* @param {Function} fn The function that will be invoked by the action's components. The function
* will be called with no arguments.
- * @param {Object} scope The scope in which the function will execute
+ * @param {Object} scope The scope (this
reference) in which the function is executed. Defaults to the Component firing the event.
*/
setHandler : function(fn, scope){
this.initialConfig.handler = fn;
@@ -210,10 +211,10 @@ Ext.Action.prototype = {
},
/**
- * Executes the specified function once for each component currently tied to this action. The function passed
+ * Executes the specified function once for each Component currently tied to this action. The function passed
* in should accept a single argument that will be an object that supports the basic Action config/method interface.
* @param {Function} fn The function to execute for each component
- * @param {Object} scope The scope in which the function will execute
+ * @param {Object} scope The scope (this
reference) in which the function is executed. Defaults to the Component.
*/
each : function(fn, scope){
Ext.each(this.items, fn, scope);
@@ -249,4 +250,4 @@ Ext.Action.prototype = {
execute : function(){
this.initialConfig.handler.apply(this.initialConfig.scope || window, arguments);
}
-};
+});