[Mobile] Remove usage of element.scope()

Usage is unnecessary and is sensitive to initialization ordering of
representations, resulting in #948.
This commit is contained in:
Victor Woeltjen 2016-05-20 16:13:51 -07:00
parent 25a2321578
commit 6e7f4df5e3
2 changed files with 5 additions and 6 deletions

View File

@ -38,7 +38,6 @@ define(
function InfoGestureButton($document, agentService, infoService, element, domainObject) {
var dismissBubble,
touchPosition,
scopeOff,
body = $document.find('body');
function trackPosition(event) {
@ -94,10 +93,6 @@ define(
element.on('click', showBubble);
}
// Also make sure we dismiss bubble if representation is destroyed
// before the mouse actually leaves it
scopeOff = element.scope().$on('$destroy', hideBubble);
return {
/**
* Detach any event handlers associated with this gesture.
@ -109,7 +104,6 @@ define(
hideBubble();
// ...and detach listeners
element.off('click', showBubble);
scopeOff();
}
};
}

View File

@ -137,6 +137,11 @@ define(
);
});
// https://github.com/nasa/openmct/issues/948
it("does not try to access scope", function () {
expect(mockElement.scope).not.toHaveBeenCalled();
});
});
}
);