[Mobile] Don't move DOM nodes

When including/excluding a DOM element via mct-device,
use replaceWith() instead of parent().append() to preserve
original ordering of DOM elements from template.
nasa/openmctweb#213.
This commit is contained in:
Victor Woeltjen
2015-10-28 09:50:48 -07:00
parent a2d06583ca
commit d1bc93cd31
2 changed files with 26 additions and 21 deletions

View File

@ -85,7 +85,7 @@ define(
function link(scope, element, attrs, ctrl, transclude) {
if (deviceMatches(attrs.mctDevice)) {
transclude(function (clone) {
element.parent().append(clone);
element.replaceWith(clone);
});
}
}