[Browse] Stopped multiple broadcasts
Stopped the menu arrow from making multiple broadcasts of contextmenu. #33.
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
{
|
||||
"key": "MenuArrowController",
|
||||
"implementation": "MenuArrowController",
|
||||
"depends": [ "$rootScope" ]
|
||||
"depends": [ "$rootScope", "$scope" ]
|
||||
}
|
||||
],
|
||||
"controls": [
|
||||
@@ -80,7 +80,8 @@
|
||||
{
|
||||
"key": "menu-arrow",
|
||||
"templateUrl": "templates/menu-arrow.html",
|
||||
"uses": [ "type" ]
|
||||
"uses": [ "action" ],
|
||||
"gestures": [ "menu" ]
|
||||
}
|
||||
],
|
||||
"services": [
|
||||
|
||||
@@ -35,12 +35,16 @@ define(
|
||||
* menu.
|
||||
* @constructor
|
||||
*/
|
||||
function MenuArrowController($rootScope) {
|
||||
function MenuArrowController($rootScope, $scope) {
|
||||
|
||||
function contextMenu() {
|
||||
console.log('contextMenu() called');
|
||||
//console.log('editor? ', $scope.domainObject.hasCapability('editor'));
|
||||
|
||||
$rootScope.$broadcast('contextmenu');
|
||||
if (true || $scope.domainObject.hasCapability('editor')) {
|
||||
//$rootScope.$broadcast('contextmenu');
|
||||
$scope.$emit('contextmenu');
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user