2

当我展开 Sitecore 内容树并且内容树出现垂直滚动条时,如果我向下滚动并选择树底部的一个项目,它会滚动到顶部。这只发生在 Firefox、IE10、IE9、Chrome 中,它运行良好。我最近进行了 Sitecore 升级。有没有人遇到过类似的问题?请帮忙!

Sitecore.NET 6.6.0(修订版 130404)
Firefox 版本 - 21,22

4

2 回答 2

1

我遇到了类似的问题,并就此联系了 Sitecore 支持。他们为我提供了以下适用于我们的解决方案:
- 打开 \sitecore\shell\Controls\Gecko.js
- 在第 668 行替换

scBrowser.prototype.resizeFixsizeElements = function() {
  var form = $$("form")[0];

  this.fixsizeElements.each(function(element) {
    var height = form.getHeight() - element.scHeightAdjustment + "px";
    element.setStyle({ height: height });
  });

  /* trigger re-layouting to fix the firefox bug: table is not shrinking itself down on resize */
  scGeckoRelayout();
}

经过:

scBrowser.prototype.resizeFixsizeElements = function() {
  var form = $$("form")[0];
  if (!form) {
    return;
  }

  this.fixsizeElements.each(function (element) {
    if (!element.hasClassName('scFixSizeNested')) {
      element.setStyle({ height: '100%' });
    }
  });

  var maxHeight = 0;
  var formChilds = form.childNodes;

  for (var i = 0; i != formChilds.length; i++) {
    var elementHeight = formChilds[i].offsetHeight;
    if (elementHeight > maxHeight) {
      maxHeight = elementHeight;
    }
  }

  var formHeight = form.offsetHeight;

  this.fixsizeElements.each(function (element) {
      var height = element.hasClassName('scFixSizeNested')
        ? (form.getHeight() - element.scHeightAdjustment) + 'px'
        : (element.offsetHeight - (maxHeight - formHeight)) + 'px';
      element.setStyle({ height: height });
  });

  /* trigger re-layouting to fix the firefox bug: table is not shrinking itself down on resize */
  scGeckoRelayout();
}
于 2013-07-02T07:00:42.793 回答
1

感谢 Sitecore 的支持,找到了问题,由于 Fixefox 在更改某些属性后立即刷新 html 控件而发生此问题。选择项目后,s width is changed and as a result it is redrawn. Developed workaround forbids changing of the controlsFirefox 静态控件的内容树面板大小(如内容树)。后果可能是 Firefox 中不正确的窗口大小调整(改变浏览器窗口的高度)。要实施解决方法,请将路径“Website\sitecore\shell\Controls\Gecko.js”下的一个令人兴奋的替换为附加的一个并清除浏览器缓存。请通知我们结果。

scBrowser.prototype.resizeFixsizeElements = function() {
  var form = $$("form")[0];
  if (!form) {
    return;
  }
  if (!this.isFirefox)
    {
      this.fixsizeElements.each(function (element) {
        if (!element.hasClassName('scFixSizeNested')) {
          element.setStyle({ height: '100%' });
        }
      });        
       var maxHeight = 0;
  var formChilds = form.childNodes;

  for (var i = 0; i != formChilds.length; i++) {
    var elementHeight = formChilds[i].offsetHeight;
    if (elementHeight > maxHeight) {
      maxHeight = elementHeight;
    }
  }
  var formHeight = form.offsetHeight;
  this.fixsizeElements.each(function (element) {
      var height = element.hasClassName('scFixSizeNested')
        ? (form.getHeight() - element.scHeightAdjustment) + 'px'
        : (element.offsetHeight - (maxHeight - formHeight)) + 'px';
      element.setStyle({ height: height });
  });   
}
  /* trigger re-layouting to fix the firefox bug: table is not shrinking itself down on resize */
  scGeckoRelayout();
}
于 2013-07-05T06:47:57.650 回答