Wallet/src/js/directives/actionSheet.js

26 lines
708 B
JavaScript
Raw Normal View History

2016-10-12 15:01:48 -04:00
'use strict';
angular.module('copayApp.directives')
.directive('actionSheet', function($rootScope, $timeout) {
2016-10-12 15:01:48 -04:00
return {
restrict: 'E',
templateUrl: 'views/includes/actionSheet.html',
transclude: true,
scope: {
show: '=actionSheetShow',
},
link: function(scope, element, attrs) {
scope.$watch('show', function() {
if(scope.show) {
$timeout(function() { scope.revealMenu = true; }, 100);
} else {
scope.revealMenu = false;
}
});
2016-10-12 15:01:48 -04:00
scope.hide = function() {
scope.show = false;
$rootScope.$broadcast('incomingDataMenu.menuHidden');
2016-10-12 15:01:48 -04:00
};
}
};
});