This topic contains 7 replies, has 2 voices, and was last updated by Avatar Hristofor 9 months ago.

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

    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
    Avatar
    Hristofor
    Participant

    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
    Avatar
    edwardsmarkf
    Participant

    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
    Avatar
    edwardsmarkf
    Participant

    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
    Avatar
    edwardsmarkf
    Participant
    #101232
    Avatar
    edwardsmarkf
    Participant

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

    #101233
    Avatar
    edwardsmarkf
    Participant
    #101245
    Avatar
    Hristofor
    Participant

    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.