mirror of
https://github.com/nasa/openmct.git
synced 2025-01-31 16:36:13 +00:00
parent
7b4ef142f5
commit
917d98bd3e
@ -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": [
|
||||
|
@ -25,6 +25,9 @@
|
||||
<span ng-if="parameters.mode" class='action'>{{parameters.mode}}</span>
|
||||
<span class='type-name'>{{type.getName()}}</span>
|
||||
<span class='title-label'>{{model.name}}</span>
|
||||
<!--a id='actions-menu' class='ui-symbol context-available' onclick="alert('Not yet functional. This will display a dropdown menu of options for this object.');">v</a-->
|
||||
<!--a id='actions-menu'
|
||||
class='ui-symbol context-available'
|
||||
ng-click='ObjectHeaderController.contextMenu()'>v</a-->
|
||||
<mct-representation key="'menu-arrow'"></mct-representation>
|
||||
</span>
|
||||
</div>
|
26
platform/commonUI/browse/res/templates/menu-arrow.html
Normal file
26
platform/commonUI/browse/res/templates/menu-arrow.html
Normal file
@ -0,0 +1,26 @@
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<span ng-controller="MenuArrowController as menuArrow">
|
||||
<a class='ui-symbol context-available'
|
||||
ng-click='menuArrow.contextMenu()'>v</a>
|
||||
</span>
|
53
platform/commonUI/browse/src/MenuArrowController.js
Normal file
53
platform/commonUI/browse/src/MenuArrowController.js
Normal file
@ -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;
|
||||
}
|
||||
);
|
@ -60,7 +60,7 @@
|
||||
{
|
||||
"key": "TreeNodeController",
|
||||
"implementation": "controllers/TreeNodeController.js",
|
||||
"depends": [ "$scope", "$timeout", "$rootScope" ]
|
||||
"depends": [ "$scope", "$timeout" ]
|
||||
},
|
||||
{
|
||||
"key": "ActionGroupController",
|
||||
|
@ -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 {
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user