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;
    }

猜你喜欢

转载自blog.csdn.net/cjpx00008/article/details/42739177
今日推荐