I have encountered several issues using the Stock object.
1) Graphical glitch when adding two items to the stock.
I have a loop where I call addToStockWithId() several times.
If I call it twice, the second element is added to the containing div without the "top" and "left" property, so it's not positioned correctly.
I managed to fix this by calling updateDisplay() at the end of the loop, but I'm not sure if that's the correct solution.
2) Stock elements don't "wrap" correctly to the next line.
When I have too many items on the screen, the last few elements are hidden behind the BGA sidebar.
The only wrap when they reach the edge of the browser window.
I wish for them to wrap when they reach the edge of the containing div.
3) How to animate a card moving between two stocks?
This thread from 2014 suggests that to animate a card moving from one stock to another, I just need to call removeFromStockById() followed by addToStockWithId() with a parameter of the previous canvas.
However, this doesn't always work. Sometimes the old card "fades out" from the old div, and a new card appears somewhere near it, and slides to the new stock. In other cases, the old card only disappears from the old stock after the slide animation to the new stock is done.
What am I doing wrong?
1) Graphical glitch when adding two items to the stock.
I have a loop where I call addToStockWithId() several times.
If I call it twice, the second element is added to the containing div without the "top" and "left" property, so it's not positioned correctly.
I managed to fix this by calling updateDisplay() at the end of the loop, but I'm not sure if that's the correct solution.
2) Stock elements don't "wrap" correctly to the next line.
When I have too many items on the screen, the last few elements are hidden behind the BGA sidebar.
The only wrap when they reach the edge of the browser window.
I wish for them to wrap when they reach the edge of the containing div.
3) How to animate a card moving between two stocks?
This thread from 2014 suggests that to animate a card moving from one stock to another, I just need to call removeFromStockById() followed by addToStockWithId() with a parameter of the previous canvas.
However, this doesn't always work. Sometimes the old card "fades out" from the old div, and a new card appears somewhere near it, and slides to the new stock. In other cases, the old card only disappears from the old stock after the slide animation to the new stock is done.
What am I doing wrong?