zoukankan      html  css  js  c++  java
  • ext 3.2 tree 在IE10中点击事件失效的bug

    ext3.2 中的tree在IE中进行兼容性测试,遇到IE10时,无法点击,其他版本的IE(7、8、9、11)均正常。此bug是由于ext-all.js中的getAttributeNS方法不能兼容IE10出错引起的,下载了ext3.4,这里的getAttributeNS 被重写了,将3.4中的方法写入3.2中的ext-all.js文件中,IE10中tree恢复正常。

    修改前:

    getAttributeNS: Ext.isIE ?
            function(s, q) {
                var t = this.dom,
                r = typeof t[s + ":" + q];
                if (!Ext.isEmpty(r) && r != "unknown") {
                    return t[s + ":" + q]
                }
                return t[q]
            }: function(r, q) {
                var s = this.dom;
                return s.getAttributeNS(r, q) || s.getAttribute(r + ":" + q) || s.getAttribute(q) || s[q]
            }

    修改后:

    getAttributeNS: function(m, l) {
                return this.getAttribute(l, m)
            },
            getAttribute: (function() {
                var p = document.createElement("table"),
                o = false,
                m = "getAttribute" in p,
                l = /undefined|unknown/;
                if (m) {
                    try {
                        p.getAttribute("ext:qtip")
                    } catch(n) {
                        o = true
                    }
                    return function(q, s) {
                        var r = this.dom,
                        t;
                        if (r.getAttributeNS) {
                            t = r.getAttributeNS(s, q) || null
                        }
                        if (t == null) {
                            if (s) {
                                if (o && r.tagName.toUpperCase() == "TABLE") {
                                    try {
                                        t = r.getAttribute(s + ":" + q)
                                    } catch(u) {
                                        t = ""
                                    }
                                } else {
                                    t = r.getAttribute(s + ":" + q)
                                }
                            } else {
                                t = r.getAttribute(q) || r[q]
                            }
                        }
                        return t || ""
                    }
                } else {
                    return function(q, s) {
                        var r = this.om,
                        u, t;
                        if (s) {
                            t = r[s + ":" + q];
                            u = l.test(typeof t) ? undefined: t
                        } else {
                            u = r[q]
                        }
                        return u || ""
                    }
                }
                p = null
            })()

    修改前效果:

    修改后效果:

  • 相关阅读:
    Linux crontab 的常用定时方式
    Windows 查看端口及进程信息
    java.io.IOException: com.esotericsoftware.kryo.KryoException
    Linux 如何让挂载的硬盘永久生效
    六边形架构-微服务基石
    包和工具
    谈一谈对java简单的理解
    HTTP报文 「HTTP
    四层 or 七层 「HTTP
    setTimeout不生效
  • 原文地址:https://www.cnblogs.com/shenyixin/p/3892807.html
Copyright © 2011-2022 走看看