blackbaud / skyux1

DEPRECATED This site contains the codebase for the AngularJS (1.x) implementation of the SKY UX framework. We no longer support this version of SKY UX, and we recommend that you use the latest version instead. https://developer.blackbaud.com/skyux/
MIT License
51 stars 68 forks source link

Do not layout tiles when a new tile is added to an existing view #1084

Closed Blackbaud-MatthewBell closed 6 years ago

Blackbaud-MatthewBell commented 6 years ago

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 https://github.com/blackbaud/skyux/issues/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.

blackbaud-sky-savage commented 6 years ago

Tests failed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 863b272441233fd255a719b8b80fe4f39de90354 Build details: https://travis-ci.org/blackbaud-sky-savage/skyux/builds/319791714

(Please note that this is a fully automated comment.)

blackbaud-sky-savage commented 6 years ago

Tests passed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: f64d8fe065519d0604f4916b4ef09cba5ac67dab Build details: https://travis-ci.org/blackbaud-sky-savage/skyux/builds/326452533

(Please note that this is a fully automated comment.)