git.ithinksw.org
/
extjs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Upgrade to ExtJS 3.3.0 - Released 10/06/2010
[extjs.git]
/
pkgs
/
pkg-menu-debug.js
diff --git
a/pkgs/pkg-menu-debug.js
b/pkgs/pkg-menu-debug.js
index
e21f0f4
..
1535060
100644
(file)
--- a/
pkgs/pkg-menu-debug.js
+++ b/
pkgs/pkg-menu-debug.js
@@
-1,5
+1,5
@@
/*!
/*!
- * Ext JS Library 3.
2.2
+ * Ext JS Library 3.
3.0
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
@@
-294,7
+294,7
@@
Ext.menu.Menu = Ext.extend(Ext.Container, {
var items = this.items;
for(var i = start, len = items.length; i >= 0 && i < len; i+= step){
var item = items.get(i);
var items = this.items;
for(var i = start, len = items.length; i >= 0 && i < len; i+= step){
var item = items.get(i);
- if(!item.disabled && (item.canActivate || item.isFormField)){
+ if(
item.isVisible() &&
!item.disabled && (item.canActivate || item.isFormField)){
this.setActiveItem(item, false);
return item;
}
this.setActiveItem(item, false);
return item;
}
@@
-549,8
+549,8
@@
Ext.menu.Menu = Ext.extend(Ext.Container, {
return c;
},
return c;
},
- applyDefaults : function(c){
- if
(!Ext.isString(c))
{
+ applyDefaults : function(c)
{
+ if
(!Ext.isString(c))
{
c = Ext.menu.Menu.superclass.applyDefaults.call(this, c);
var d = this.internalDefaults;
if(d){
c = Ext.menu.Menu.superclass.applyDefaults.call(this, c);
var d = this.internalDefaults;
if(d){
@@
-566,10
+566,10
@@
Ext.menu.Menu = Ext.extend(Ext.Container, {
},
// private
},
// private
- getMenuItem : function(config){
-
if(!config.isXType)
{
- if
(!config.xtype && Ext.isBoolean(config.checked))
{
- return new Ext.menu.CheckItem(config)
+ getMenuItem : function(config)
{
+
if (!config.isXType)
{
+ if
(!config.xtype && Ext.isBoolean(config.checked))
{
+ return new Ext.menu.CheckItem(config)
;
}
return Ext.create(config, this.defaultType);
}
}
return Ext.create(config, this.defaultType);
}
@@
-580,7
+580,7
@@
Ext.menu.Menu = Ext.extend(Ext.Container, {
* Adds a separator bar to the menu
* @return {Ext.menu.Item} The menu item that was added
*/
* Adds a separator bar to the menu
* @return {Ext.menu.Item} The menu item that was added
*/
- addSeparator : function(){
+ addSeparator : function()
{
return this.add(new Ext.menu.Separator());
},
return this.add(new Ext.menu.Separator());
},
@@
-589,7
+589,7
@@
Ext.menu.Menu = Ext.extend(Ext.Container, {
* @param {Mixed} el The element or DOM node to add, or its id
* @return {Ext.menu.Item} The menu item that was added
*/
* @param {Mixed} el The element or DOM node to add, or its id
* @return {Ext.menu.Item} The menu item that was added
*/
- addElement : function(el){
+ addElement : function(el)
{
return this.add(new Ext.menu.BaseItem({
el: el
}));
return this.add(new Ext.menu.BaseItem({
el: el
}));
@@
-600,7
+600,7
@@
Ext.menu.Menu = Ext.extend(Ext.Container, {
* @param {Ext.menu.Item} item The menu item to add
* @return {Ext.menu.Item} The menu item that was added
*/
* @param {Ext.menu.Item} item The menu item to add
* @return {Ext.menu.Item} The menu item that was added
*/
- addItem : function(item){
+ addItem : function(item)
{
return this.add(item);
},
return this.add(item);
},
@@
-609,7
+609,7
@@
Ext.menu.Menu = Ext.extend(Ext.Container, {
* @param {Object} config A MenuItem config object
* @return {Ext.menu.Item} The menu item that was added
*/
* @param {Object} config A MenuItem config object
* @return {Ext.menu.Item} The menu item that was added
*/
- addMenuItem : function(config){
+ addMenuItem : function(config)
{
return this.add(this.getMenuItem(config));
},
return this.add(this.getMenuItem(config));
},
@@
-801,18
+801,6
@@
Ext.menu.MenuMgr = function(){
}
}
}
}
- // private
- function onBeforeCheck(mi, state){
- if(state){
- var g = groups[mi.group];
- for(var i = 0, l = g.length; i < l; i++){
- if(g[i] != mi){
- g[i].setChecked(false);
- }
- }
- }
- }
-
return {
/**
return {
/**
@@
-875,7
+863,6
@@
Ext.menu.MenuMgr = function(){
groups[g] = [];
}
groups[g].push(menuItem);
groups[g] = [];
}
groups[g].push(menuItem);
- menuItem.on("beforecheckchange", onBeforeCheck);
}
},
}
},
@@
-884,7
+871,23
@@
Ext.menu.MenuMgr = function(){
var g = menuItem.group;
if(g){
groups[g].remove(menuItem);
var g = menuItem.group;
if(g){
groups[g].remove(menuItem);
- menuItem.un("beforecheckchange", onBeforeCheck);
+ }
+ },
+
+ // private
+ onCheckChange: function(item, state){
+ if(item.group && state){
+ var group = groups[item.group],
+ i = 0,
+ len = group.length,
+ current;
+
+ for(; i < len; i++){
+ current = group[i];
+ if(current != item){
+ current.setChecked(false);
+ }
+ }
}
},
}
},
@@
-1095,15
+1098,17
@@
Ext.menu.TextItem = Ext.extend(Ext.menu.BaseItem, {
*/
itemCls : "x-menu-text",
*/
itemCls : "x-menu-text",
- constructor : function(config){
- if(typeof config == 'string'){
- config = {text: config}
+ constructor : function(config) {
+ if (typeof config == 'string') {
+ config = {
+ text: config
+ };
}
Ext.menu.TextItem.superclass.constructor.call(this, config);
},
// private
}
Ext.menu.TextItem.superclass.constructor.call(this, config);
},
// private
- onRender : function(){
+ onRender : function()
{
var s = document.createElement("span");
s.className = this.itemCls;
s.innerHTML = this.text;
var s = document.createElement("span");
s.className = this.itemCls;
s.innerHTML = this.text;
@@
-1196,6
+1201,12
@@
Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, {
* @cfg {Number} showDelay Length of time in milliseconds to wait before showing this item (defaults to 200)
*/
showDelay: 200,
* @cfg {Number} showDelay Length of time in milliseconds to wait before showing this item (defaults to 200)
*/
showDelay: 200,
+
+ /**
+ * @cfg {String} altText The altText to use for the icon, if it exists. Defaults to <tt>''</tt>.
+ */
+ altText: '',
+
// doc'd in BaseItem
hideDelay: 200,
// doc'd in BaseItem
hideDelay: 200,
@@
-1219,7
+1230,7
@@
Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, {
' target="{hrefTarget}"',
'</tpl>',
'>',
' target="{hrefTarget}"',
'</tpl>',
'>',
- '<img src="{icon}" class="x-menu-item-icon {iconCls}"/>',
+ '<img
alt="{altText}"
src="{icon}" class="x-menu-item-icon {iconCls}"/>',
'<span class="x-menu-item-text">{text}</span>',
'</a>'
);
'<span class="x-menu-item-text">{text}</span>',
'</a>'
);
@@
-1242,7
+1253,8
@@
Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, {
hrefTarget: this.hrefTarget,
icon: this.icon || Ext.BLANK_IMAGE_URL,
iconCls: this.iconCls || '',
hrefTarget: this.hrefTarget,
icon: this.icon || Ext.BLANK_IMAGE_URL,
iconCls: this.iconCls || '',
- text: this.itemText||this.text||' '
+ text: this.itemText||this.text||' ',
+ altText: this.altText || ''
};
},
};
},
@@
-1382,7
+1394,7
@@
Ext.menu.CheckItem = Ext.extend(Ext.menu.Item, {
/**
* @cfg {Boolean} checked True to initialize this checkbox as checked (defaults to false). Note that
/**
* @cfg {Boolean} checked True to initialize this checkbox as checked (defaults to false). Note that
- * if this checkbox is part of a radio group (group = true) only the
la
st item in the group that is
+ * if this checkbox is part of a radio group (group = true) only the
fir
st item in the group that is
* initialized with checked = true will be rendered as checked.
*/
checked: false,
* initialized with checked = true will be rendered as checked.
*/
checked: false,
@@
-1447,6
+1459,7
@@
Ext.menu.CheckItem = Ext.extend(Ext.menu.Item, {
setChecked : function(state, suppressEvent){
var suppress = suppressEvent === true;
if(this.checked != state && (suppress || this.fireEvent("beforecheckchange", this, state) !== false)){
setChecked : function(state, suppressEvent){
var suppress = suppressEvent === true;
if(this.checked != state && (suppress || this.fireEvent("beforecheckchange", this, state) !== false)){
+ Ext.menu.MenuMgr.onCheckChange(this, state);
if(this.container){
this.container[state ? "addClass" : "removeClass"]("x-menu-item-checked");
}
if(this.container){
this.container[state ? "addClass" : "removeClass"]("x-menu-item-checked");
}