mirror of
https://github.com/nasa/openmct.git
synced 2025-02-20 17:33:23 +00:00
[Mobile] Reformat of menu
Reformats menu to move the arrow to the right and now that is what selects an object. Pressing the actual menu item will enact the dropdown menu. This only happens on mobile platforms.
This commit is contained in:
parent
dcdafbaebf
commit
56e51ea32a
@ -143,8 +143,6 @@ define(
|
||||
|
||||
$scope.treeSlide = function () {
|
||||
$scope.treeClass = !$scope.treeClass;
|
||||
// FUTURE: Remove before merge
|
||||
console.log($scope.treeClass ? "browse-showtree" : "browse-hidetree");
|
||||
};
|
||||
|
||||
// Listen for changes in navigation state.
|
||||
|
@ -8,6 +8,11 @@
|
||||
"key": "urlService",
|
||||
"implementation": "/services/UrlService.js",
|
||||
"depends": [ "$location" ]
|
||||
},
|
||||
{
|
||||
"key": "queryService",
|
||||
"implementation": "/services/QueryService.js",
|
||||
"depends": [ "$window" ]
|
||||
}
|
||||
],
|
||||
"runs": [
|
||||
@ -60,7 +65,7 @@
|
||||
{
|
||||
"key": "TreeNodeController",
|
||||
"implementation": "controllers/TreeNodeController.js",
|
||||
"depends": [ "$scope", "$timeout" ]
|
||||
"depends": [ "$scope", "$timeout", "queryService" ]
|
||||
},
|
||||
{
|
||||
"key": "ActionGroupController",
|
||||
|
@ -306,3 +306,42 @@ ul.tree {
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
@media screen and (orientation: portrait) and (max-width: 514px) and (max-height: 740px) and (max-device-width: 799px) and (max-device-height: 1024px), screen and (orientation: landscape) and (max-height: 514px) and (max-width: 740px) and (max-device-width: 799px) and (max-device-height: 1024px), screen and (orientation: landscape) and (max-height: 514px) and (max-width: 740px) and (max-device-width: 1024px) and (max-device-height: 799px), screen and (orientation: portrait) and (min-width: 515px) and (max-width: 799px) and (min-height: 741px) and (max-height: 1024px) and (max-device-width: 799px) and (max-device-height: 1024px), screen and (orientation: landscape) and (min-height: 515px) and (max-height: 799px) and (min-width: 741px) and (max-width: 1024px) and (max-device-width: 799px) and (max-device-height: 1024px), screen and (orientation: landscape) and (min-height: 515px) and (max-height: 799px) and (min-width: 741px) and (max-width: 1024px) and (max-device-width: 1024px) and (max-device-height: 799px) {
|
||||
/* line 22, ../sass/mobile/_tree.scss */
|
||||
.test-tree-words {
|
||||
margin-bottom: 7px;
|
||||
width: 90%;
|
||||
text-overflow: ellipsis; } }
|
||||
|
||||
@media screen and (orientation: portrait) and (max-width: 514px) and (max-height: 740px) and (max-device-width: 799px) and (max-device-height: 1024px), screen and (orientation: landscape) and (max-height: 514px) and (max-width: 740px) and (max-device-width: 799px) and (max-device-height: 1024px), screen and (orientation: landscape) and (max-height: 514px) and (max-width: 740px) and (max-device-width: 1024px) and (max-device-height: 799px), screen and (orientation: portrait) and (min-width: 515px) and (max-width: 799px) and (min-height: 741px) and (max-height: 1024px) and (max-device-width: 799px) and (max-device-height: 1024px), screen and (orientation: landscape) and (min-height: 515px) and (max-height: 799px) and (min-width: 741px) and (max-width: 1024px) and (max-device-width: 799px) and (max-device-height: 1024px), screen and (orientation: landscape) and (min-height: 515px) and (max-height: 799px) and (min-width: 741px) and (max-width: 1024px) and (max-device-width: 1024px) and (max-device-height: 799px) {
|
||||
/* line 30, ../sass/mobile/_tree.scss */
|
||||
ul.tree {
|
||||
margin: 0;
|
||||
padding: 0; }
|
||||
/* line 267, ../sass/_mixins.scss */
|
||||
ul.tree li {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0; }
|
||||
/* line 39, ../sass/mobile/_tree.scss */
|
||||
ul.tree li span.tree-item .label {
|
||||
left: 3px; }
|
||||
/* line 43, ../sass/mobile/_tree.scss */
|
||||
ul.tree li span.tree-item .label .type-icon .alert {
|
||||
right: auto;
|
||||
left: 9px; }
|
||||
/* line 48, ../sass/mobile/_tree.scss */
|
||||
ul.tree li span.tree-item .label .title-label {
|
||||
left: 20px; }
|
||||
/* line 53, ../sass/mobile/_tree.scss */
|
||||
ul.tree li span.tree-item .context-trigger {
|
||||
right: 3px; }
|
||||
/* line 57, ../sass/mobile/_tree.scss */
|
||||
ul.tree li span.tree-item .view-control {
|
||||
position: relative;
|
||||
left: 100%;
|
||||
right: 0;
|
||||
font-size: 1.5em; }
|
||||
/* line 67, ../sass/mobile/_tree.scss */
|
||||
ul.tree ul.tree {
|
||||
margin-left: 3px; } }
|
||||
|
@ -52,7 +52,7 @@ $tabHeiLanCheck: "(min-width: #{$tabMinH}) and (max-width: #{$tabMaxH})";
|
||||
$tabletLandscapeCheck: "#{$tabWidLanCheck} and #{$tabHeiLanCheck}";
|
||||
|
||||
$desktopPortraitCheck: "(min-device-width: #{$compMinW}) and (min-device-height: #{$compMinH})";
|
||||
$desktopLanscapeCheck: "(min-device-width: #{$compMinH}) and (min-device-height: #{$compMinW})";
|
||||
$desktopLandscapeCheck: "(min-device-width: #{$compMinH}) and (min-device-height: #{$compMinW})";
|
||||
|
||||
/************************** MEDIA QUERIES: WINDOWS FOR SPECIFIC ORIENTATIONS FOR EACH DEVICE */
|
||||
$phonePortrait: "#{$screenPortrait} and #{$phonePortraitCheck} and #{$mobileDevice}";
|
||||
@ -64,7 +64,7 @@ $tabletLandscape: "#{$screenLandscape} and #{$tabletLandscapeCheck} and #{$mobil
|
||||
$tabletLandscapeEmu: "#{$screenLandscape} and #{$tabletLandscapeCheck} and #{$mobileDeviceEmu}";
|
||||
|
||||
$desktopPortrait: "screen and #{$desktopPortraitCheck}";
|
||||
$desktopLandscape: "screen and #{$desktopLanscapeCheck}";
|
||||
$desktopLandscape: "screen and #{$desktopLandscapeCheck}";
|
||||
|
||||
/************************** DEVICE PARAMETERS FOR MENUS/REPRESENTATIONS */
|
||||
$phoneRepSizePortrait: 19px;
|
||||
|
@ -56,4 +56,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,12 +19,53 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
.test-tree-words {
|
||||
@include phoneandtablet {
|
||||
margin-bottom: 7px;
|
||||
width: 90%;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
//mobile-flat-list {
|
||||
// // For lists of tree-items that are flat. Remove margin, etc. normally needed for the expansion arrow.
|
||||
// .tree-item {
|
||||
// .label {
|
||||
// left: -100px;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
ul.tree {
|
||||
@include phoneandtablet {
|
||||
@include menuUlReset();
|
||||
li {
|
||||
span.tree-item {
|
||||
$runningItemW: 0;
|
||||
$customMargin: auto;
|
||||
$runningItemW: $interiorMargin + $treeVCW;
|
||||
|
||||
.label {
|
||||
left: 3px;
|
||||
|
||||
.type-icon {
|
||||
.alert {
|
||||
right: auto;
|
||||
left: 9px;
|
||||
}
|
||||
}
|
||||
.title-label {
|
||||
left: $runningItemW + ($interiorMargin);
|
||||
}
|
||||
}
|
||||
|
||||
.context-trigger {
|
||||
right: $interiorMarginSm;
|
||||
}
|
||||
|
||||
.view-control {
|
||||
position: relative;
|
||||
left: 100%;
|
||||
right: 0;
|
||||
font-size: 1.5em;
|
||||
$runningItemW: $interiorMargin + $treeVCW;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ul.tree {
|
||||
margin-left: 3px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,23 +22,25 @@
|
||||
<span ng-controller="ToggleController as toggle">
|
||||
<span ng-controller="TreeNodeController as treeNode">
|
||||
<span
|
||||
class="tree-item menus-to-left"
|
||||
class="tree-item menus-to-left test-tree-words"
|
||||
ng-class="{selected: treeNode.isSelected()}"
|
||||
>
|
||||
<span
|
||||
class='ui-symbol view-control'
|
||||
ng-click="toggle.toggle(); treeNode.trackExpansion()"
|
||||
ng-if="model.composition !== undefined"
|
||||
>
|
||||
{{toggle.isActive() ? "v" : ">"}}
|
||||
</span>
|
||||
<mct-representation
|
||||
key="'label'"
|
||||
<mct-representation
|
||||
key="'label'"
|
||||
mct-object="domainObject"
|
||||
ng-model="ngModel"
|
||||
ng-click="ngModel.selectedObject = domainObject"
|
||||
ng-click="!treeNode.checkMobile() ? ngModel.selectedObject = domainObject : toggle.toggle(); treeNode.trackExpansion()"
|
||||
>
|
||||
</mct-representation>
|
||||
<span
|
||||
class='ui-symbol view-control'
|
||||
mct-object="domainObject"
|
||||
ng-model="ngModel"
|
||||
ng-click="treeNode.checkMobile() ? ngModel.selectedObject = domainObject : toggle.toggle(); treeNode.trackExpansion()"
|
||||
ng-if="model.composition !== undefined || treeNode.checkMobile()"
|
||||
>
|
||||
{{treeNode.checkMobile() ? ">" : toggle.isActive() ? "v" : ">"}}
|
||||
</span>
|
||||
</span>
|
||||
<span
|
||||
class="tree-item-subtree"
|
||||
|
@ -50,7 +50,7 @@ define(
|
||||
* expand-to-show-navigated-object behavior.)
|
||||
* @constructor
|
||||
*/
|
||||
function TreeNodeController($scope, $timeout) {
|
||||
function TreeNodeController($scope, $timeout, queryService) {
|
||||
var selectedObject = ($scope.ngModel || {}).selectedObject,
|
||||
isSelected = false,
|
||||
hasBeenExpanded = false;
|
||||
@ -86,7 +86,11 @@ define(
|
||||
$timeout(function () { hasBeenExpanded = true; }, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function checkMobile() {
|
||||
return queryService.isMobile();
|
||||
}
|
||||
|
||||
// Consider the currently-navigated object and update
|
||||
// parameters which support display.
|
||||
function checkSelection() {
|
||||
@ -150,6 +154,9 @@ define(
|
||||
* lazy loading of the node's subtree.
|
||||
*/
|
||||
trackExpansion: trackExpansion,
|
||||
|
||||
checkMobile: checkMobile,
|
||||
|
||||
/**
|
||||
* Check if this not has ever been expanded.
|
||||
* @returns true if it has been expanded
|
||||
|
85
platform/commonUI/general/src/services/QueryService.js
Normal file
85
platform/commonUI/general/src/services/QueryService.js
Normal file
@ -0,0 +1,85 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,Promise*/
|
||||
|
||||
/**
|
||||
* Module defining QueryService.
|
||||
*/
|
||||
|
||||
var phoMaxWidth = 514,
|
||||
phoMaxHeight = 740,
|
||||
|
||||
tabMinWidth = 515,
|
||||
tabMaxWidth = 799,
|
||||
|
||||
tabMinHeight = 741,
|
||||
tabMaxHeight = 1024,
|
||||
|
||||
compMinWidth = 800,
|
||||
compMinHeight = 1025;
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* The url service handles calls for url paths
|
||||
* using domain objects.
|
||||
*/
|
||||
function QueryService($window) {
|
||||
|
||||
|
||||
|
||||
function getDeviceUA() {
|
||||
var ua = navigator.userAgent;
|
||||
return ua.match(/iPad|iPhone|Android/i) ?
|
||||
ua.match(/iPad|iPhone|Android/i) : "";
|
||||
}
|
||||
|
||||
function isMobile() {
|
||||
if (getDeviceUA()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getOrientation(screenWidth, screenHeight) {
|
||||
if ($window.screen.width > $window.screen.height) {
|
||||
return "landscape";
|
||||
} else if ($window.screen.width < $window.screen.height) {
|
||||
return "portrait";
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
getOrientation: getOrientation,
|
||||
|
||||
isMobile: isMobile
|
||||
};
|
||||
}
|
||||
|
||||
return QueryService;
|
||||
}
|
||||
);
|
Loading…
x
Reference in New Issue
Block a user