Wallet/src/js/directives/slideToAcceptSuccess.js

31 lines
867 B
JavaScript
Raw Normal View History

2016-10-07 20:03:51 -04:00
'use strict';
angular.module('copayApp.directives')
.directive('slideToAcceptSuccess', function($timeout) {
return {
restrict: 'E',
templateUrl: 'views/includes/slideToAcceptSuccess.html',
transclude: true,
scope: {
isShown: '=slideSuccessShow',
onConfirm: '&slideSuccessOnConfirm'
},
link: function(scope, element, attrs) {
var elm = element[0];
elm.style.display = 'none';
scope.$watch('isShown', function() {
if(scope.isShown) {
elm.style.display = 'flex';
$timeout(function() {
scope.fillScreen = true;
}, 10);
}
});
scope.onConfirmButtonClick = function() {
scope.onConfirm();
scope.fillScreen = false;
elm.style.display = 'none';
};
}
};
});