* @extends Roo.bootstrap.Component
* Bootstrap Button class
* @cfg {String} html The button content
- * @cfg {String} weight default (or empty) | primary | success | info | warning | danger
+ * @cfg {String} weight default (or empty) | primary | success | info | warning | danger | link
* @cfg {String} size empty | lg | sm | xs
* @cfg {String} tag empty | a | input | submit
* @cfg {String} href empty or href
}
if (this.sticky.length) {
+
var bd = Roo.get(document.body);
if (!bd.hasClass('bootstrap-sticky')) {
bd.addClass('bootstrap-sticky');
* Bootstrap MenuItem class
* @cfg {String} html the menu label
* @cfg {String} href the link
+ * @cfg {Boolean} preventDefault (true | false) default true
*
*
* @constructor
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,
+ preventDefault: true,
getAutoCreate : function(){
var 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);
}
});
Roo.bootstrap.Menu=function(A){Roo.bootstrap.Menu.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Menu,Roo.bootstrap.Component,{triggerEl:false,type:false,getChildContainer:function(){return this.el;},getAutoCreate:function(){var A={tag:'ul',cls:'dropdown-menu'};if(this.type==='submenu'){A.cls='submenu active'}return A;},initEvents:function(){this.triggerEl.on('click',this.toggle,this);this.triggerEl.addClass('dropdown-toggle');},toggle:function(e){if(Roo.get(e.getTarget()).findParent('.dropdown-menu')){return;}var A=this.triggerEl.hasClass('open');this.clearMenus(e);this.triggerEl[A?'removeClass':'addClass']('open');this.triggerEl.focus();e.preventDefault();},clearMenus:function(){Roo.select('.dropdown-toggle',true).each(function(aa){if(!aa.hasClass('open')){return;}
aa.removeClass('open');})}});
//Roo/bootstrap/MenuItem.js
-Roo.bootstrap.MenuItem=function(A){Roo.bootstrap.MenuItem.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.MenuItem,Roo.bootstrap.Component,{href:false,html:false,getAutoCreate:function(){var A={tag:'li',cn:[{tag:'a',href:'#',html:'Link'}]};A.cn[0].href=this.href||A.cn[0].href;A.cn[0].html=this.html||A.cn[0].html;return A;}});
+Roo.bootstrap.MenuItem=function(A){Roo.bootstrap.MenuItem.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.MenuItem,Roo.bootstrap.Component,{href:false,html:false,preventDefault:true,getAutoCreate:function(){var A={tag:'li',cn:[{tag:'a',href:'#',html:'Link'}]};A.cn[0].href=this.href||A.cn[0].href;A.cn[0].html=this.html||A.cn[0].html;return A;},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);}});
//Roo/bootstrap/MenuSeparator.js
Roo.bootstrap.MenuSeparator=function(A){Roo.bootstrap.MenuSeparator.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.MenuSeparator,Roo.bootstrap.Component,{getAutoCreate:function(){var A={cls:'divider',tag:'li'};return A;}});
//Roo/bootstrap/Modal.js