Author: nbelaevski
Date: 2008-08-13 13:36:11 -0400 (Wed, 13 Aug 2008)
New Revision: 10077
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
Log:
Remove bad utility methods
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
===================================================================
---
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2008-08-13
15:35:50 UTC (rev 10076)
+++
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2008-08-13
17:36:11 UTC (rev 10077)
@@ -401,94 +401,4 @@
parentNode.removeChild(node);
}
}
-};
-
-//patched for 'fixed' positioning & 9.5 opera version of prototype.js
-//viewportOffset()
-//FIXME: seem to not work well when starting elements have margins
-Richfaces.getViewPortOffset = function(forElement) {
- var valueT = 0, valueL = 0;
-
- var startElement = forElement;
-
- if (Richfaces.getComputedStyle(startElement, 'position') == 'absolute')
{
- startElement = Element.getOffsetParent(startElement);
- }
-
- var element = startElement;
-
- do {
- valueT += (element.offsetTop || 0);
- valueL += (element.offsetLeft || 0);
-
- var position = Richfaces.getComputedStyle(element, 'position');
-
- if (element != forElement || position != 'relative') {
- valueT += (element.clientTop || 0);
- valueL += (element.clientLeft || 0);
- }
-
- if (position == 'fixed') {
- break;
- }
-
- // Safari fix
- if (element.offsetParent == document.body &&
- position == 'absolute') {
- break;
- }
-
- } while (element = element.offsetParent);
-
- element = startElement;
- do {
- valueT -= element.scrollTop || 0;
- valueL -= element.scrollLeft || 0;
-
- if (Richfaces.getComputedStyle(element, 'position') == 'fixed') {
- break;
- }
-
- } while (element = element.parentNode);
-
- return [valueL, valueT];
-};
-
-Richfaces.clonePosition = function(element, source, opts) {
- var options = Object.extend({
- setLeft: true,
- setTop: true,
- setWidth: true,
- setHeight: true,
- offsetTop: 0,
- offsetLeft: 0
- }, opts || { });
-
- // find page position of source
- source = $(source);
- var p = Richfaces.getViewPortOffset(source);
-
- // find coordinate system to use
- element = $(element);
- var delta = [0, 0];
- var parent = null;
- // delta [0,0] will do fine with position: fixed elements,
- // position:absolute needs offsetParent deltas
- if (Richfaces.getComputedStyle(element, 'position') == 'absolute') {
- parent = element.getOffsetParent();
- delta = Richfaces.getViewPortOffset(parent);
- }
-
- // correct by body offsets (fixes Safari)
- if (parent == document.body) {
- delta[0] -= document.body.offsetLeft;
- delta[1] -= document.body.offsetTop;
- }
-
- // set position
- if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) +
'px';
- if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) +
'px';
- if (options.setWidth) element.style.width = source.offsetWidth + 'px';
- if (options.setHeight) element.style.height = source.offsetHeight + 'px';
- return element;
-};
+};
\ No newline at end of file
Show replies by date