Changed Roo/Element.jsRoo/EventManager.jsRoo/bootstrap/Card.jsRoo/bootstrap/Element.js
authorAlan Knowles <alan@roojs.com>
Thu, 8 Apr 2021 09:05:05 +0000 (17:05 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 8 Apr 2021 09:05:05 +0000 (17:05 +0800)
Roo/Element.js
Roo/EventManager.js
Roo/bootstrap/Card.js
Roo/bootstrap/Element.js

index fef561b..3b3270c 100644 (file)
@@ -1172,7 +1172,26 @@ if(opt.anim.isAnimated()){
             if (this.dom) {
                 Roo.EventManager.on(this.dom,  eventName, fn, scope || this, options);
             }
+            if (eventName == 'dblclick') {
+                this.addEventListener('touchstart', this.onTapHandler, this);
+            }
         },
+        tapedTwice : false,
+        onTapHandler : function(event)
+        {
+            if(!this.tapedTwice) {
+                this.tapedTwice = true;
+                var s = this;
+                setTimeout( function() {
+                    s.tapedTwice = false;
+                }, 300 );
+                return;
+            }
+            event.preventDefault();
+            this.fireEvent('dblclick', this, event);
+            //action on double tap goes below
+             
+        }, 
 
         /**
          * Removes an event handler from this element
@@ -2304,7 +2323,7 @@ if(opt.anim.isAnimated()){
         /**
          * @private
          */
-      fitToParentDelegate : Roo.emptyFn, // keep a reference to the fitToParent delegate
+        fitToParentDelegate : Roo.emptyFn, // keep a reference to the fitToParent delegate
 
         /**
          * Sizes this element to its parent element's dimensions performing
index fc718c7..3c9a41a 100644 (file)
@@ -122,6 +122,7 @@ Roo.EventManager = function(){
         }
     }
     
+  
 
     var listen = function(element, ename, opt, fn, scope){
         var o = (!opt || typeof opt == "boolean") ? {} : opt;
index 04dc146..58c24ac 100644 (file)
@@ -91,8 +91,8 @@ Roo.bootstrap.Card = function(config){
          * @param {Roo.bootstrap.Card} this
          * @param {Object} data from dragdrop 
          */
-         'cardover' : true 
-        
+         'cardover' : true
+         
     });
 };
 
index bed0e4a..5756f64 100644 (file)
@@ -31,7 +31,9 @@ Roo.bootstrap.Element = function(config){
          * @param {Roo.bootstrap.Element} this
          * @param {Roo.EventObject} e
          */
-        "click" : true
+        "click" : true 
+        
+      
     });
 };
 
@@ -42,6 +44,7 @@ Roo.extend(Roo.bootstrap.Element, Roo.bootstrap.Component,  {
     html: '',
     preventDefault: false, 
     clickable: false,
+    tapedTwice : false,
     
     getAutoCreate : function(){
         
@@ -62,6 +65,7 @@ Roo.extend(Roo.bootstrap.Element, Roo.bootstrap.Component,  {
             this.el.on('click', this.onClick, this);
         }
         
+        
     },
     
     onClick : function(e)
@@ -70,9 +74,14 @@ Roo.extend(Roo.bootstrap.Element, Roo.bootstrap.Component,  {
             e.preventDefault();
         }
         
-        this.fireEvent('click', this, e);
+        this.fireEvent('dblclick', this, e);
     },
     
+    
+    
+
+    
+    
     getValue : function()
     {
         return this.el.dom.innerHTML;