This repository has been archived by the owner on Dec 8, 2022. It is now read-only.
Do not layout tiles when a new tile is added to an existing view - Local #1086
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The objective of this change is to reduce the occassions when a tile is
moved in the DOM, as the act of moving a DOM element has negative
consequences when it contains an iFrame
(https://stackoverflow.com/questions/8318264/how-to-move-an-iframe-in-the-dom-without-losing-its-state).
Currently when a Tile directive is added into a tile view, the
initialization of that tile directive forces the dashboard to layout the
tiles again. A common scenario for this is a tile-view that performs
logic/security checks before adding the tile directive. Layout of the
tiles in this case is unnecessary. Even though the tile itself is new,
the tile-view element that contains the tile already exists and was
initially layed out properly.
The reason the tile initialization forces the dashboard to layout the
tiles is due to the issue #182.
In this case the page $state is changing, impacting the actual tile-view
elements. When the $state changes and a view now exists that previously
did not, the tile-view element is recreated and it is placed back at its
original location. This behavior occurs from the ui-view directive. In
this case, the tile does need to be layed out again.
This change differentiates these scenarios by adding an attribute to the
view element to determine if it has been layed out or not.