[Browse] Stopped multiple broadcasts

Stopped the menu arrow from making multiple
broadcasts of contextmenu. #33.
This commit is contained in:
Sarah Hale
2015-06-30 15:22:10 -07:00
parent 917d98bd3e
commit 4840345524
3 changed files with 19 additions and 9 deletions

View File

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

View File

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