diff --git a/platform/commonUI/browse/bundle.json b/platform/commonUI/browse/bundle.json index e10f3e9048..9221ac049d 100644 --- a/platform/commonUI/browse/bundle.json +++ b/platform/commonUI/browse/bundle.json @@ -32,6 +32,11 @@ "key": "LocatorController", "implementation": "creation/LocatorController", "depends": [ "$scope" ] + }, + { + "key": "MenuArrowController", + "implementation": "MenuArrowController", + "depends": [ "$rootScope" ] } ], "controls": [ @@ -71,6 +76,11 @@ "key": "object-header", "templateUrl": "templates/browse/object-header.html", "uses": [ "type" ] + }, + { + "key": "menu-arrow", + "templateUrl": "templates/menu-arrow.html", + "uses": [ "type" ] } ], "services": [ diff --git a/platform/commonUI/browse/res/templates/browse/object-header.html b/platform/commonUI/browse/res/templates/browse/object-header.html index eb13bb3764..48f494466e 100644 --- a/platform/commonUI/browse/res/templates/browse/object-header.html +++ b/platform/commonUI/browse/res/templates/browse/object-header.html @@ -25,6 +25,9 @@ {{parameters.mode}} {{type.getName()}} {{model.name}} - + + \ No newline at end of file diff --git a/platform/commonUI/browse/res/templates/menu-arrow.html b/platform/commonUI/browse/res/templates/menu-arrow.html new file mode 100644 index 0000000000..dc92358e0c --- /dev/null +++ b/platform/commonUI/browse/res/templates/menu-arrow.html @@ -0,0 +1,26 @@ + + + + v + \ No newline at end of file diff --git a/platform/commonUI/browse/src/MenuArrowController.js b/platform/commonUI/browse/src/MenuArrowController.js new file mode 100644 index 0000000000..55ae7632c0 --- /dev/null +++ b/platform/commonUI/browse/src/MenuArrowController.js @@ -0,0 +1,53 @@ +/***************************************************************************** + * 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*/ + +/** + * Module defining ObjectHeaderController. Created by shale on 06/30/2015. + */ +define( + [], + function () { + "use strict"; + + /** + * A left-click on the menu arrow should display a + * context menu. This controller launches the context + * menu. + * @constructor + */ + function MenuArrowController($rootScope) { + + function contextMenu() { + console.log('contextMenu() called'); + + $rootScope.$broadcast('contextmenu'); + } + + return { + contextMenu: contextMenu + }; + } + + return MenuArrowController; + } +); \ No newline at end of file diff --git a/platform/commonUI/general/bundle.json b/platform/commonUI/general/bundle.json index e5da0b81ef..2093a988cd 100644 --- a/platform/commonUI/general/bundle.json +++ b/platform/commonUI/general/bundle.json @@ -60,7 +60,7 @@ { "key": "TreeNodeController", "implementation": "controllers/TreeNodeController.js", - "depends": [ "$scope", "$timeout", "$rootScope" ] + "depends": [ "$scope", "$timeout" ] }, { "key": "ActionGroupController", diff --git a/platform/representation/src/gestures/ContextMenuGesture.js b/platform/representation/src/gestures/ContextMenuGesture.js index 28e0f1ad30..58b08e12b9 100644 --- a/platform/representation/src/gestures/ContextMenuGesture.js +++ b/platform/representation/src/gestures/ContextMenuGesture.js @@ -61,8 +61,7 @@ define( goUp = eventCoors[1] + menuDim[1] > winDim[1], menu; - //console.log('in showMenu() in ContextMenuGesture'); - //console.log('domainObject is ', domainObject); + console.log('in showMenu() in ContextMenuGesture'); // Remove the context menu function dismiss() { @@ -92,6 +91,8 @@ define( "context-menu-holder": true }; + console.log(scope); + // Create the context menu menu = $compile(MENU_TEMPLATE)(scope); @@ -107,7 +108,10 @@ define( // When context menu event occurs, show object actions instead element.on('contextmenu', showMenu); - $rootScope.$on('leftContextual', showMenu); + + // This allows actions besides only right-clicks to trigger a + // context menu + $rootScope.$on('contextmenu', showMenu); return { /**