[Browse] Splitting up Menu Gesture
Splitting up the context menu gesture's functionality into separate context menu gesture and context menu actions. The gesture watches for right-clicks, while the action displays the menu. #33.
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
{
|
||||
"key": "MenuArrowController",
|
||||
"implementation": "MenuArrowController",
|
||||
"depends": [ "$rootScope", "$scope" ]
|
||||
"depends": [ "$scope" ]
|
||||
}
|
||||
],
|
||||
"controls": [
|
||||
|
||||
@@ -22,5 +22,5 @@
|
||||
|
||||
<span ng-controller="MenuArrowController as menuArrow">
|
||||
<a class='ui-symbol context-available'
|
||||
ng-click='menuArrow.contextMenu()'>v</a>
|
||||
ng-click='menuArrow.showMenu($event)'>v</a>
|
||||
</span>
|
||||
@@ -35,20 +35,22 @@ define(
|
||||
* menu.
|
||||
* @constructor
|
||||
*/
|
||||
function MenuArrowController($rootScope, $scope) {
|
||||
function MenuArrowController($scope) {
|
||||
|
||||
function contextMenu() {
|
||||
function showMenu(event) {
|
||||
console.log('contextMenu() called');
|
||||
//console.log('editor? ', $scope.domainObject.hasCapability('editor'));
|
||||
|
||||
/*
|
||||
if (true || $scope.domainObject.hasCapability('editor')) {
|
||||
//$rootScope.$broadcast('contextmenu');
|
||||
$scope.$emit('contextmenu');
|
||||
$scope.$emit('contextmenu', event);
|
||||
}
|
||||
*/
|
||||
|
||||
$scope.domainObject.getCapability('action').perform({key: 'contextMenu', event: event});
|
||||
}
|
||||
|
||||
return {
|
||||
contextMenu: contextMenu
|
||||
showMenu: showMenu
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user