Roo.js
[roojs1] / Roo.js
diff --git a/Roo.js b/Roo.js
index f1d5ebe..89e3acf 100644 (file)
--- a/Roo.js
+++ b/Roo.js
@@ -63,9 +63,16 @@ Roo.apply = function(o, c, defaults){
         isMac = (ua.indexOf("macintosh") != -1 || ua.indexOf("mac os x") != -1),
         isLinux = (ua.indexOf("linux") != -1),
         isSecure = window.location.href.toLowerCase().indexOf("https") === 0,
-        isIOS = /iphone|ipad\./.test(ua),
+        isIOS = /iphone|ipad/.test(ua),
         isTouch =  (function() {
-            try {  
+            try {
+                if (ua.indexOf('chrome') != -1 && ua.indexOf('android') == -1) {
+                    window.addEventListener('touchstart', function __set_has_touch__ () {
+                        Roo.isTouch = true;
+                        window.removeEventListener('touchstart', __set_has_touch__);
+                    });
+                    return false; // no touch on chrome!?
+                }
                 document.createEvent("TouchEvent");  
                 return true;  
             } catch (e) {  
@@ -307,6 +314,7 @@ Roo.factory(conf, Roo.data);
         {
             // no xtype, no ns or c.xns - or forced off by c.xns
             if (!c.xtype   || (!ns && !c.xns) ||  (c.xns === false)) { // not enough info...
+                Roo.log('in???');
                 return c;
             }
             ns = c.xns ? c.xns : ns; // if c.xns is set, then use that..
@@ -314,7 +322,7 @@ Roo.factory(conf, Roo.data);
                 return c;
             }
             if (ns[c.xtype]) {
-                if (Roo.debug) Roo.log("Roo.Factory(" + c.xtype + ")");
+                if (Roo.debug) { Roo.log("Roo.Factory(" + c.xtype + ")"); }
                 var ret = new ns[c.xtype](c);
                 ret.xns = false;
                 return ret;