From 56e51ea32a6155d1875e1bc0b219a3be31448e89 Mon Sep 17 00:00:00 2001 From: Shivam Dave Date: Tue, 21 Jul 2015 13:29:45 -0700 Subject: [PATCH] [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. --- .../commonUI/browse/src/BrowseController.js | 2 - platform/commonUI/general/bundle.json | 7 +- platform/commonUI/general/res/css/tree.css | 39 +++++++++ .../general/res/sass/mobile/_constants.scss | 4 +- .../general/res/sass/mobile/_item.scss | 2 +- .../general/res/sass/mobile/_tree.scss | 57 +++++++++++-- .../general/res/templates/tree-node.html | 24 +++--- .../src/controllers/TreeNodeController.js | 11 ++- .../general/src/services/QueryService.js | 85 +++++++++++++++++++ 9 files changed, 204 insertions(+), 27 deletions(-) create mode 100644 platform/commonUI/general/src/services/QueryService.js diff --git a/platform/commonUI/browse/src/BrowseController.js b/platform/commonUI/browse/src/BrowseController.js index b05793b15f..9bf040d3eb 100644 --- a/platform/commonUI/browse/src/BrowseController.js +++ b/platform/commonUI/browse/src/BrowseController.js @@ -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. diff --git a/platform/commonUI/general/bundle.json b/platform/commonUI/general/bundle.json index 2093a988cd..25635d6093 100644 --- a/platform/commonUI/general/bundle.json +++ b/platform/commonUI/general/bundle.json @@ -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", diff --git a/platform/commonUI/general/res/css/tree.css b/platform/commonUI/general/res/css/tree.css index 3fe58b337d..fbbd16e929 100644 --- a/platform/commonUI/general/res/css/tree.css +++ b/platform/commonUI/general/res/css/tree.css @@ -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; } } diff --git a/platform/commonUI/general/res/sass/mobile/_constants.scss b/platform/commonUI/general/res/sass/mobile/_constants.scss index 27761e2132..198bf6f652 100644 --- a/platform/commonUI/general/res/sass/mobile/_constants.scss +++ b/platform/commonUI/general/res/sass/mobile/_constants.scss @@ -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; diff --git a/platform/commonUI/general/res/sass/mobile/_item.scss b/platform/commonUI/general/res/sass/mobile/_item.scss index 2b74671628..9542645136 100644 --- a/platform/commonUI/general/res/sass/mobile/_item.scss +++ b/platform/commonUI/general/res/sass/mobile/_item.scss @@ -56,4 +56,4 @@ } } } -} \ No newline at end of file +} diff --git a/platform/commonUI/general/res/sass/mobile/_tree.scss b/platform/commonUI/general/res/sass/mobile/_tree.scss index 673ff6c066..5d24928a4b 100644 --- a/platform/commonUI/general/res/sass/mobile/_tree.scss +++ b/platform/commonUI/general/res/sass/mobile/_tree.scss @@ -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; -// } -// } -//} \ No newline at end of file +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; + } + } +} diff --git a/platform/commonUI/general/res/templates/tree-node.html b/platform/commonUI/general/res/templates/tree-node.html index f584befb1a..2e4c48ec3a 100644 --- a/platform/commonUI/general/res/templates/tree-node.html +++ b/platform/commonUI/general/res/templates/tree-node.html @@ -22,23 +22,25 @@ - - {{toggle.isActive() ? "v" : ">"}} - - + + {{treeNode.checkMobile() ? ">" : toggle.isActive() ? "v" : ">"}} + $window.screen.height) { + return "landscape"; + } else if ($window.screen.width < $window.screen.height) { + return "portrait"; + } + } + + return { + getOrientation: getOrientation, + + isMobile: isMobile + }; + } + + return QueryService; + } +); \ No newline at end of file