mirror of
https://github.com/nasa/openmct.git
synced 2025-06-20 16:10:23 +00:00
[Mobile] Small tweaks/bug fixes
Small tweaks/fixes (use appropriate variable names etc) for refactoring mobile support classes.
This commit is contained in:
@ -41,7 +41,7 @@ define(
|
|||||||
*/
|
*/
|
||||||
function AgentService($window) {
|
function AgentService($window) {
|
||||||
var userAgent = $window.navigator.userAgent,
|
var userAgent = $window.navigator.userAgent,
|
||||||
matches = ua.match(/iPad|iPhone|Android/i) || [];
|
matches = userAgent.match(/iPad|iPhone|Android/i) || [];
|
||||||
|
|
||||||
this.mobileName = matches[0];
|
this.mobileName = matches[0];
|
||||||
this.$window = $window;
|
this.$window = $window;
|
||||||
@ -79,7 +79,7 @@ define(
|
|||||||
* @returns {boolean} true in portrait mode
|
* @returns {boolean} true in portrait mode
|
||||||
*/
|
*/
|
||||||
AgentService.prototype.isPortrait = function () {
|
AgentService.prototype.isPortrait = function () {
|
||||||
return $window.innerWidth < $window.innerHeight;
|
return this.$window.innerWidth < this.$window.innerHeight;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -43,7 +43,10 @@ define(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (agentService.isMobile()) {
|
if (agentService.isMobile()) {
|
||||||
navigationService.listen(changeObject);
|
navigationService.addListener(changeObject);
|
||||||
|
$scope.$on("$destroy", function () {
|
||||||
|
navigationService.removeListener(changeObject);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.state = true;
|
this.state = true;
|
||||||
|
Reference in New Issue
Block a user