aprsworld / wsWebDisplay

0 stars 0 forks source link

Z-index on elements saving versus loading #105

Open Cdetviler opened 8 years ago

Cdetviler commented 8 years ago

Jim demonstrated an issue where he placed two cameras on the page one on top of the other, and when he loaded the layout later, the z-index had switched. It was unclear what the z-index was of each camera, but since Jim did not mention changing the z-index, it is safe to assume that they were at their default - 100.

If I had to guess the reason why this happens it is because a new element added overlaps an element that was added previously.

Loading must switch the order somehow. Interesting enough, it only seems to happen with camera objects. If I had to guess, I would say that it is because when loading the camera objects, the image is preloaded.

So basically:

camera 1 = 1028KB in size camera 2 = 500KB in size

Even if camera 1 was initiated first by the load function, camera 2 would most likely be created first. Thus switching the order.

kb0thn commented 8 years ago

When creating the page, I would not set the z-index to be all the same. Set the z-index so each item gets a higher (or whatever closer to the front is) index.

On 4/20/2016 9:20 AM, Charlie Detviler wrote:

Jim demonstrated an issue where he placed two cameras on the page one on top of the other, and when he loaded the layout later, the z-index had switched. It was unclear what the z-index was of each camera, but since Jim did not mention changing the z-index, it is safe to assume that they were at their default - 100.

If I had to guess the reason why this happens it is because a new element added overlaps an element that was added previously.

Loading must switch the order somehow. Interesting enough, it only seems to happen with camera objects. If I had to guess, I would say that it is because when loading the camera objects, the image is preloaded.

So basically:

camera 1 = 1028KB in size camera 2 = 500KB in size

Even if camera 1 was initiated first by the load function, camera 2 would most likely be created first. Thus switching the order.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/aprsworld/wsWebDisplay/issues/105

-James Jefferson Jarvis APRS World, LLC +1-507-454-2727 www.aprsworld.com

Cdetviler commented 8 years ago

Items added to the page now have incremental z-index instead of being set automatically to 100. The z-index slider in the edit pane also reflects this by having the high-end of its range set to 100+number_of_elements_on_page, incrementing for every element that is added to the page. Unfortunately layouts that were saved previously to this will not see any change because I didn't want to override any z-index that were manually changed by the user.