[mochikit] getViewportDimensions doc bug

2006-03-03 Thread Leonardo Soto M
Docs says: getViewportDimensions(element) But the function has no arguments. -- Leonardo Soto M. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups MochiKit group. To post to this group, send email to

[mochikit] elementInnerDimensions

2006-03-03 Thread Leonardo Soto M
Hi!, Sometimes I need to get the 'client' dimension of an element, not the regular dimension that elementDimension() returns. [See www.mozilla.org/docs/dom/domref/clientWidth.html]. The following function works: :mochidef:`elementInnerDimensions(element)`: Return the absolute pixel

[mochikit] Re: getViewportDimensions doc bug

2006-03-03 Thread Leonardo Soto M
Beau Hartshorne wrote: Thanks for pointing this out. Do you think the function should take an optional win parameter? Doesn't withWindow() already covers that?. -- Leonardo Soto M. Desarrollador de Software | Administrador de Sistemas [EMAIL PROTECTED] | [EMAIL PROTECTED]

[mochikit] Re: getViewportDimensions doc bug

2006-03-03 Thread Beau Hartshorne
That'd be me. Is this correct: getViewportDimensions: function() { var d = new MochiKit.DOM.Dimensions(); var self = MochiKit.DOM; if (window.innerWidth) { d.w = self._window.innerWidth; d.h = self._window.innerHeight; } else if

[mochikit] Re: getViewportDimensions doc bug

2006-03-03 Thread Bob Ippolito
Not quite, there are a two spots that I can see that you missed: if (window.innerWidth) { .. } else if (self._document.body document.body.clientWidth) { I'd write it more compactly using a couple more locals instead of repeating self.foo.bar.baz ad nauseam. -bob On Mar 3, 2006,