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