sencha touch 小米3无法点击问题 修复

修改源码文件夹下event/publisher/Dom.js中的attachListener方法,代码如下

attachListener: function(eventName, doc) {
        if (!doc) {
            doc = document;
        }

        var defaultView = doc.defaultView;

        if (Ext.os.is.iOS && Ext.os.version.getMajor() < 5) {
            document.addEventListener(eventName, this.onEvent, !this.doesEventBubble(eventName));
        }
        else if (defaultView && defaultView.addEventListener) {
            //这里对米3做了适配
            if(/MI 3 Build/.test(navigator.userAgent)){
                document.addEventListener(eventName, this.onEvent, !this.doesEventBubble(eventName));
            }else{
                doc.defaultView.addEventListener(eventName, this.onEvent, !this.doesEventBubble(eventName));
            }
        }
        else {
            doc.addEventListener(eventName, this.onEvent, !this.doesEventBubble(eventName));
        }
        return this;
    }

 

 

posted on 2014-06-10 11:01  想啦牛肉面  阅读(801)  评论(1编辑  收藏  举报

导航