style override question

  • Hi,

    the <style> element is only a simple data/attribute storage - and when a new plugin/layer/hotspot will be created and has a style attribute set, then the attributes from the given <style> element will be copied to it (does the same as the loadstyle() action) .

    Implementing a real full style system like in CSS would be way more complex and would make everything way slower. Please don't forget that krpano as web-application is only AS3(Flash) or Javascript(HTML5) code and not native code, so there are performance limitations and to keep things fast and simple, they shouldn't be too complex.

    That means that <style> is basically only a little helper tool that allows defining the attributes that are the same for several elements together at one place.

    But I'm looking for ways to make it possible to resolve the styles before settings the xml attributes of course - maybe by an additional pre-xml-parser step, but here again there are some performance-tradeoffs to consider... I can't say yet if or when that would be possible.

    Best regards,
    Klaus

  • Maybe just a check to see if the attribute is not empty or null before applying an attribute from a style would work.
    Styles are great but they could be better with this check.

    You have a style for a nice plugin, but suddenly you want to make one with a tiny change, and you either have to not use the style, make a duplicate style, or put all your customizations in the onloaded event.
    This would allow for style libraries you can pick and choose from without having to worry about conflicts in creating plugins/hotspots and troubleshooting.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!