[dev] estimate display area of block

Michael J Rubinsky mrubinsk at horde.org
Sun Jul 16 22:44:02 UTC 2017


Quoting Sebastian Birnbach <birnbacs at gmail.com>:

> I am working on a block that outputs an SVG visualisation. It would be
> helpful to know how much space there is available.
> I see that there is no way of knowing this in terms of cm or px. Is there
> at least a way of determining the column width of the block (1-col, 2-col)?

Obviously you would need to get the px dimensions from the front ent.  
I.e., in Javascript.

As far as the layout properties, a Block doesn't know anything about  
it's layout, that's the job of the Collection and Layout managers. You  
might be able to look up the block's details by grabbing the layout  
from Horde_Core_Block_Collection from within your block's code.  
Otherwise, I'd suggest using javascript to get the dimensions of a  
specific div (or other DOM element) inside your block's own DOM element.

>
> Thanks
>
>   birnbacs
> --
> dev mailing list
> Frequently Asked Questions: http://wiki.horde.org/FAQ
> To unsubscribe, mail: dev-unsubscribe at lists.horde.org



-- 
mike
The Horde Project
http://www.horde.org
https://www.facebook.com/hordeproject
https://www.twitter.com/hordeproject
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-keys
Size: 9272 bytes
Desc: PGP Public Key
URL: <https://lists.horde.org/archives/dev/attachments/20170716/7ea14d37/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 821 bytes
Desc: PGP Digital Signature
URL: <https://lists.horde.org/archives/dev/attachments/20170716/7ea14d37/attachment-0001.bin>


More information about the dev mailing list