roojs-bootstrap.js
authorAlan Knowles <alan@roojs.com>
Wed, 12 May 2021 07:12:55 +0000 (15:12 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 12 May 2021 07:12:55 +0000 (15:12 +0800)
roojs-bootstrap-debug.js
Roo/bootstrap/Element.js

Roo/bootstrap/Element.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index dbb7f36..84ef16a 100644 (file)
@@ -47,6 +47,7 @@ Roo.extend(Roo.bootstrap.Element, Roo.bootstrap.Component,  {
     preventDefault: false, 
     clickable: false,
     tapedTwice : false,
+    role : false,
     
     getAutoCreate : function(){
         
@@ -55,6 +56,9 @@ Roo.extend(Roo.bootstrap.Element, Roo.bootstrap.Component,  {
             // cls: this.cls, double assign in parent class Component.js :: onRender
             html: this.html
         };
+        if (this.role !== false) {
+            cfg.role = this.role;
+        }
         
         return cfg;
     },
index de7ca35..e708a70 100644 (file)
@@ -650,6 +650,8 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent,  {
  * @cfg {String} cls class of the element
  * @cfg {Boolean} preventDefault (true|false) default false
  * @cfg {Boolean} clickable (true|false) default false
+ * @cfg {String} role default blank - set to button to force cursor pointer
  * 
  * @constructor
  * Create a new Element
@@ -681,6 +683,7 @@ Roo.extend(Roo.bootstrap.Element, Roo.bootstrap.Component,  {
     preventDefault: false, 
     clickable: false,
     tapedTwice : false,
+    role : false,
     
     getAutoCreate : function(){
         
@@ -689,6 +692,9 @@ Roo.extend(Roo.bootstrap.Element, Roo.bootstrap.Component,  {
             // cls: this.cls, double assign in parent class Component.js :: onRender
             html: this.html
         };
+        if (this.role !== false) {
+            cfg.role = this.role;
+        }
         
         return cfg;
     },
index 8f407cb..10a228a 100644 (file)
@@ -25,9 +25,9 @@ return cn;}var I=A.items;delete A.items;if(!skip_children){for(var i=0;i<I.lengt
 }if(typeof(this.visibilityEl)=='string'){return this.visibilityEl=='parent'?this.parent().getEl():this.getEl();}return this.getEl();},show:function(){if(!this.getVisibilityEl()){return;}this.getVisibilityEl().removeClass(['hidden','d-none']);this.fireEvent('show',this);
 },hide:function(){if(!this.getVisibilityEl()){return;}this.getVisibilityEl().addClass(['hidden','d-none']);this.fireEvent('hide',this);}});
 // Roo/bootstrap/Element.js
-Roo.bootstrap.Element=function(A){Roo.bootstrap.Element.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.Element,Roo.bootstrap.Component,{tag:'div',cls:'',html:'',preventDefault:false,clickable:false,tapedTwice:false,getAutoCreate:function(){var A={tag:this.tag,html:this.html}
-;return A;},initEvents:function(){Roo.bootstrap.Element.superclass.initEvents.call(this);if(this.clickable){this.el.on('click',this.onClick,this);}},onClick:function(e){if(this.preventDefault){e.preventDefault();}this.fireEvent('dblclick',this,e);},getValue:function(){return this.el.dom.innerHTML;
-},setValue:function(A){this.el.dom.innerHTML=A;}});
+Roo.bootstrap.Element=function(A){Roo.bootstrap.Element.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.Element,Roo.bootstrap.Component,{tag:'div',cls:'',html:'',preventDefault:false,clickable:false,tapedTwice:false,role:false,getAutoCreate:function(){var A={tag:this.tag,html:this.html}
+;if(this.role!==false){A.role=this.role;}return A;},initEvents:function(){Roo.bootstrap.Element.superclass.initEvents.call(this);if(this.clickable){this.el.on('click',this.onClick,this);}},onClick:function(e){if(this.preventDefault){e.preventDefault();}this.fireEvent('dblclick',this,e);
+},getValue:function(){return this.el.dom.innerHTML;},setValue:function(A){this.el.dom.innerHTML=A;}});
 // Roo/bootstrap/DropTarget.js
 Roo.bootstrap.DropTarget=function(A){Roo.bootstrap.DropTarget.superclass.constructor.call(this,A);this.addEvents({"drop":true});};Roo.extend(Roo.bootstrap.DropTarget,Roo.bootstrap.Element,{getAutoCreate:function(){},initEvents:function(){Roo.bootstrap.DropTarget.superclass.initEvents.call(this);
 this.dropZone=new Roo.dd.DropTarget(this.getEl(),{ddGroup:this.name,listeners:{drop:this.dragDrop.createDelegate(this),enter:this.dragEnter.createDelegate(this),out:this.dragOut.createDelegate(this),over:this.dragOver.createDelegate(this)}});this.dropZone.DDM.useCache=false}