Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #101200
    edwardsmarkf
    Member

    hello –   this is probably obvious but i am missing it.
    what is the best way to specify where a window will INITIALLY open?   i have had success using css & top/left, but before i pursue this any further i wanted to see if the htmlElements wizards had a much better way.
    thank you.

    #101201
    Hristofor
    Member

    Hi edwardsmarkf,
    By default the Smart.Window component is positioned via CSS using the top/left CSS properties. However if the Window has been resized/dragged you will have to set the top/left inline in order to take precedence. So initially it is correct to style it via CSS top/left properties.
    Best Regards,
    Christopher
    Smart HTML Elements Team
    https://www.htmlelements.com

    #101221
    edwardsmarkf
    Member

    thanks,   but when i try to set the top/left properties and open MINIMIZED, it seems to override whatever top/left properties i set.
    also, when using the ‘minimize’ event, that event triggers before the minimize takes place, and overrides it there as well.  i could possibly have some sort of timeout event, but i wanted to ask here first to see if there is a better way?

    #101222
    edwardsmarkf
    Member

    this works, sort of:

    window.onload = () => {
    const smartWindow = document.querySelector('smart-window');
    smartWindow.headerButtons = ['collapse', 'minimize', 'pin'];
    smartWindow.addEventListener('minimize', (event) => {
    setTimeout( () => {
    document.querySelector('smart-window').style.left = '300px' ;
    }, 100);
    });
    };
    
    #101227
    edwardsmarkf
    Member

    reposting question here:  https://www.htmlelements.com/forums/topic/locating-minimized-window/

    #101232
    edwardsmarkf
    Member

    could you please show me a working example of setting top/left?

    #101233
    edwardsmarkf
    Member
    #101245
    Hristofor
    Member

    Hi edwardsmarkf,
    Changing the position of the Smart.Window while minimized is not possible via the API of the element at the moment. The default position of the window when minimized is the bottom left corner of the viewport. Every other minimized window will be positioned right next to it. The minimize event should not be used to change the position of the minimized window.
    Best Regards,
    Christopher
    Smart HTML Elements Team
    https://www.htmlelements.com
    Tags:
    web components, web component, custom element, smart elements, smart framework

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.