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
]]>
« Sorry guys, the hunger for knowledge is not subsiding… xD (Previous Post)
(Next Post) I’m back guys! »
< ![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();
]]>
< ![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();
}
}
]]>
< ![CDATA[
I’ll need to have a closer look at this then…
]]>
< ![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.
]]>
< ![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.
]]>