From 07ef4dfe8adf1ff48d0aa8ff31cb13f859c1e508 Mon Sep 17 00:00:00 2001 From: Dave Date: Wed, 8 Jul 2015 14:27:59 -0700 Subject: [PATCH] [Mobile] Menu Slide Menu slides, but not transition css slides out on click. Currently uses document, which needs to be replaced with angular version using and/or and/or ng-class and/or ng-click. --- .../commonUI/browse/res/templates/browse.html | 4 +- .../res/templates/browse/object-header.html | 5 +- .../res/templates/create/create-button.html | 3 -- platform/commonUI/general/bundle.json | 5 ++ .../general/res/css/theme-espresso.css | 16 +++++-- .../general/res/sass/mobile/_layout.scss | 17 +++++-- .../src/controllers/ClickAwayController.js | 7 --- .../src/controllers/TreeMenuController.js | 48 +++++++++++++++++++ 8 files changed, 84 insertions(+), 21 deletions(-) create mode 100644 platform/commonUI/general/src/controllers/TreeMenuController.js diff --git a/platform/commonUI/browse/res/templates/browse.html b/platform/commonUI/browse/res/templates/browse.html index c955d596eb..a8f25caa7d 100644 --- a/platform/commonUI/browse/res/templates/browse.html +++ b/platform/commonUI/browse/res/templates/browse.html @@ -19,11 +19,11 @@ this source code distribution or the Licensing information page available at runtime from the About dialog for additional information. --> -
+
-
+
diff --git a/platform/commonUI/browse/res/templates/browse/object-header.html b/platform/commonUI/browse/res/templates/browse/object-header.html index eb13bb3764..91f6df04d2 100644 --- a/platform/commonUI/browse/res/templates/browse/object-header.html +++ b/platform/commonUI/browse/res/templates/browse/object-header.html @@ -19,7 +19,10 @@ this source code distribution or the Licensing information page available at runtime from the About dialog for additional information. --> -
+
+
+ T +
{{type.getGlyph()}} {{parameters.mode}} diff --git a/platform/commonUI/browse/res/templates/create/create-button.html b/platform/commonUI/browse/res/templates/create/create-button.html index 6f1efc9604..527afd9882 100644 --- a/platform/commonUI/browse/res/templates/create/create-button.html +++ b/platform/commonUI/browse/res/templates/create/create-button.html @@ -27,7 +27,4 @@
-
- T -
\ No newline at end of file diff --git a/platform/commonUI/general/bundle.json b/platform/commonUI/general/bundle.json index 2dd8d5dc4c..428a1f667d 100644 --- a/platform/commonUI/general/bundle.json +++ b/platform/commonUI/general/bundle.json @@ -85,6 +85,11 @@ "implementation": "controllers/ClickAwayController.js", "depends": [ "$scope", "$document" ] }, + { + "key": "TreeMenuController", + "implementation": "controllers/TreeMenuController.js", + "depends": [ "$element", "$document" ] + }, { "key": "ViewSwitcherController", "implementation": "controllers/ViewSwitcherController.js", diff --git a/platform/commonUI/general/res/css/theme-espresso.css b/platform/commonUI/general/res/css/theme-espresso.css index 284072886c..0e9d54dbe9 100644 --- a/platform/commonUI/general/res/css/theme-espresso.css +++ b/platform/commonUI/general/res/css/theme-espresso.css @@ -731,16 +731,26 @@ mct-container { * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ +@media screen and (max-width: 800px) { + /* line 26, ../sass/mobile/_layout.scss */ + .holder-hide { + left: -150px; } } + +@media screen and (max-width: 800px) { + /* line 32, ../sass/mobile/_layout.scss */ + .holder-show { + left: -150px; } } + @media screen and (max-width: 514px) { - /* line 31, ../sass/mobile/_layout.scss */ + /* line 38, ../sass/mobile/_layout.scss */ .browse-manage { width: 100px; } } @media screen and (min-width: 515px) and (max-width: 800px) { - /* line 31, ../sass/mobile/_layout.scss */ + /* line 38, ../sass/mobile/_layout.scss */ .browse-manage { width: 150px; } } @media screen and (min-width: 801px) { - /* line 31, ../sass/mobile/_layout.scss */ + /* line 38, ../sass/mobile/_layout.scss */ .browse-manage { min-width: 150px; max-width: 800px; diff --git a/platform/commonUI/general/res/sass/mobile/_layout.scss b/platform/commonUI/general/res/sass/mobile/_layout.scss index 7533561b83..d8ab1b3d02 100644 --- a/platform/commonUI/general/res/sass/mobile/_layout.scss +++ b/platform/commonUI/general/res/sass/mobile/_layout.scss @@ -22,11 +22,18 @@ // style="min-width: 150px; max-width: 800px; width: 25%;" // NOTE: Added to adjust the browse folder tree list view -//.hider-check { -// @include phoneandtablet { -// -// } -//} + +.holder-hide { + @include phoneandtablet { + left: -150px; + } +} + +.holder-show { + @include phoneandtablet { + left: 0px; + } +} .browse-manage { @include phone { diff --git a/platform/commonUI/general/src/controllers/ClickAwayController.js b/platform/commonUI/general/src/controllers/ClickAwayController.js index 2b75ffba41..88965ca497 100644 --- a/platform/commonUI/general/src/controllers/ClickAwayController.js +++ b/platform/commonUI/general/src/controllers/ClickAwayController.js @@ -58,9 +58,6 @@ define( activate(); } } - function changeTree() { - console.log("WWWWW"); - } @@ -96,10 +93,6 @@ define( */ toggle: function () { changeState(); - }, - - showtree: function () { - changeTree(); } }; diff --git a/platform/commonUI/general/src/controllers/TreeMenuController.js b/platform/commonUI/general/src/controllers/TreeMenuController.js new file mode 100644 index 0000000000..5d951bb4ad --- /dev/null +++ b/platform/commonUI/general/src/controllers/TreeMenuController.js @@ -0,0 +1,48 @@ +/***************************************************************************** + * 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*/ + +define( + [], + function () { + "use strict"; + + function TreeMenuController($scope, $document) { + return { + toggle: function () { + if (document.getElementById("myElement"). + className.match(/(?:^|\s)holder-hide(?!\S)/)) { + document.getElementById("myElement").className = + document.getElementById("myElement") + .className.replace(/(?:^|\s)holder-hide(?!\S)/g, ''); + } else { + document.getElementById("myElement").className += " holder-hide"; + } + + } + }; + + } + + return TreeMenuController; + } +); \ No newline at end of file