I have a widget in folder.

I have a widget in folder. Folder window is located on top and size is computed from LL. Long tap action starts a script which changes the size of the widget via item.setCell(). I think before the new layout editor came, it was OK. But now the window of the folder does no auto resize, when items in it are resized from script. Pierre Hébert​

]]>

5 Commentsto I have a widget in folder.

  1. Anonymous says:

    < ![CDATA[

    I think this is because of an optimization, handling geometry changes is now processed faster but the container is not fully reloaded (hence the speedup). I will see whether this can be improved. In the meantime maybe try to force an update of the container using something like this:


    var prop = folder.getContainer().getProperties();


    prop.edit().setBoolean(‘newOnGrid’, prop.getBoolean(‘newOnGrid’)).commit();

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Pierre Hébert​ tried your workaround, but now container is closed by script. Don’t know why. Here my script:



    var ev=LL.getEvent();


    if(ev.getSource()==”I_LONG_CLICK”)


    {


    var it=ev.getItem();


    if(it.getName()==”MP3Player”)


    {


    var cell=it.getCell();


    var ch=cell.getBottom()-cell.getTop();


    //alert(ch);


    if(ch==1)


    {


    it.setCell(cell.getLeft(),cell.getTop(),cell.getRight(),cell.getBottom()+4);


    }


    else


    if (ch >= 5)


    {


    it.setCell(cell.getLeft(),cell.getTop(),cell.getRight(),cell.getBottom()-4);


    }


    var ct=it.getParent();


    var prop=ct.getProperties();


    prop.edit().setBoolean(‘newOnGrid’,prop.getBoolean(‘newOnGrid’)).commit();


    }


    }

    ]]>

  3. Anonymous says:

    < ![CDATA[

    I’ll need to have a closer look at this then…

    ]]>

  4. Anonymous says:

    < ![CDATA[

    Pierre Hébert​ I tried it with blank item named MP3Player in a new created Folder. Assigned script on tap and on long tap gesture.



    Tap gesture does nothing.



    Long tap closes folder.

    ]]>

  5. Anonymous says:

    < ![CDATA[

    Pierre Hébert​ I found a workaround. I had to update the items properties. But the commit has to be done after a timeout of 500 ms.


    I think the optimization speedup is to fast. I could not fast enough release the finger from screen. The commit of the properties redraws the item. I assume to redraw the item it is shortly deleted. At this time LL recognizes a tap on empty space because of users finger is still in long tap mode and this forces the default gesture to close the folder.

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *