projects
/
roojs1
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ef5e74a
)
Roo/bootstrap/MenuItem.js
author
Edward
<edward@roojs.com>
Wed, 16 Apr 2014 11:55:39 +0000
(19:55 +0800)
committer
Edward
<edward@roojs.com>
Wed, 16 Apr 2014 11:55:39 +0000
(19:55 +0800)
Roo/bootstrap/MenuItem.js
patch
|
blob
|
history
diff --git
a/Roo/bootstrap/MenuItem.js
b/Roo/bootstrap/MenuItem.js
index
524423e
..
89fc634
100644
(file)
--- a/
Roo/bootstrap/MenuItem.js
+++ b/
Roo/bootstrap/MenuItem.js
@@
-12,6
+12,7
@@
* Bootstrap MenuItem class
* @cfg {String} html the menu label
* @cfg {String} href the link
* Bootstrap MenuItem class
* @cfg {String} html the menu label
* @cfg {String} href the link
+ * @cfg {Boolean} preventDefault (true | false) default true
*
*
* @constructor
*
*
* @constructor
@@
-22,12
+23,22
@@
Roo.bootstrap.MenuItem = function(config){
Roo.bootstrap.MenuItem.superclass.constructor.call(this, config);
Roo.bootstrap.MenuItem = function(config){
Roo.bootstrap.MenuItem.superclass.constructor.call(this, config);
+ this.addEvents({
+ // raw events
+ /**
+ * @event click
+ * The raw click event for the entire grid.
+ * @param {Roo.EventObject} e
+ */
+ "click" : true
+ });
};
Roo.extend(Roo.bootstrap.MenuItem, Roo.bootstrap.Component, {
href : false,
html : false,
};
Roo.extend(Roo.bootstrap.MenuItem, Roo.bootstrap.Component, {
href : false,
html : false,
+ preventDefault: true,
getAutoCreate : function(){
var cfg= {
getAutoCreate : function(){
var cfg= {
@@
-44,6
+55,21
@@
Roo.extend(Roo.bootstrap.MenuItem, Roo.bootstrap.Component, {
cfg.cn[0].href = this.href || cfg.cn[0].href ;
cfg.cn[0].html = this.html || cfg.cn[0].html ;
return cfg;
cfg.cn[0].href = this.href || cfg.cn[0].href ;
cfg.cn[0].html = this.html || cfg.cn[0].html ;
return cfg;
+ },
+
+ initEvents: function() {
+
+ this.el.on('click', this.onClick, this);
+
+ },
+ onClick : function(e)
+ {
+ Roo.log('item on click ');
+ if(this.preventDefault){
+ e.preventDefault();
+ }
+
+ this.fireEvent('click', this, e);
}
});
}
});