Chrome和Firefox中的GetOrgChart鼠标移动中断

时间:2017-10-18 23:21:31

标签: javascript getorgchart

我正在努力让最新版本的GetOrgChart适用于我的公司网站,但其网站上的最新版本在Firefox和Chrome中无法正常运行。鼠标滚动和移动不起作用,但它在IE中工作正常。我从去年发现了一个使用Way Back Machine的工作版本,但是当比较这两个版本时,有太多的变化,我对JavaScript的了解不足以找出问题所在。

1 个答案:

答案 0 :(得分:2)

我正在使用GetOrgChart版本2.4.8 虽然使用了相同版本的镀铬装置,但我在机芯方面遇到了类似的问题,并且箭头在某些机器上无法工作或显示。但是如果你专门用以下代码更新了getorgchart.js文件,那么问题就解决了。 因此,搜索此代码块并从

更改它
if (this.config.enableMove) {
        if ("ontouchstart" in window) {
            this._q(this._X._t, "touchstart", this._y, "canvasContainer");
            this._q(this._X._t, "touchmove", this._b, "canvasContainer");
            this._q(this._X._t, "touchend", this._g, "canvasContainer")
        } else {
            this._q(this._X._zr, "mousedown", this._aS);
            this._q(this._X._am, "mousedown", this._aS);
            this._q(this._X._Q, "mousedown", this._aS);
            this._q(this._X._zB, "mousedown", this._aS);
            this._q(this._X._t, "mousemove", this._aA);
            this._q(this._X._t, "mousedown", this._aQ);
            this._q(this._X._t, "mouseup", this._aZ);
            this._q(this._X._t, "mouseleave", this._aZ)
       }
    }

分为:

if (this.config.enableMove) {
            this._q(this._X._zr, "mousedown", this._aS);
            this._q(this._X._am, "mousedown", this._aS);
            this._q(this._X._Q, "mousedown", this._aS);
            this._q(this._X._zB, "mousedown", this._aS);
            this._q(this._X._t, "mousemove", this._aA);
            this._q(this._X._t, "mousedown", this._aQ);
            this._q(this._X._t, "mouseup", this._aZ);
            this._q(this._X._t, "mouseleave", this._aZ)
       }