[Browse] Created Menu Arrow

Created a menu-arrow respresentation. #33.
This commit is contained in:
Sarah Hale 2015-06-30 13:33:40 -07:00
parent 7b4ef142f5
commit 917d98bd3e
6 changed files with 101 additions and 5 deletions

View File

@ -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": [

View File

@ -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>

View 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>

View 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;
}
);

View File

@ -60,7 +60,7 @@
{
"key": "TreeNodeController",
"implementation": "controllers/TreeNodeController.js",
"depends": [ "$scope", "$timeout", "$rootScope" ]
"depends": [ "$scope", "$timeout" ]
},
{
"key": "ActionGroupController",

View File

@ -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 {
/**