add qr scanner to send tab

This commit is contained in:
Gabriel Bazán 2016-09-26 18:03:00 -03:00
commit 34f337d7b6
2 changed files with 20 additions and 7 deletions

View file

@ -8,11 +8,14 @@
<div class="item item-heading" translate>Recipient</div>
<label class="item item-input bitcoin-address">
<i class="icon ion-search placeholder-icon"></i>
<input type="text"
placeholder="Search or enter bitcoin address"
ng-model="formData.search"
ng-change="findContact(formData.search)"
ng-model-onblur>
<div class="qr-scan-icon" ng-style="{'width': '100%'}">
<qr-scanner class="qr-icon size-24" ng-style="{'top': '3px'}" on-scan="onQrCodeScanned(data)"></qr-scanner>
<input type="text"
placeholder="Search or enter bitcoin address"
ng-model="formData.search"
ng-change="findContact(formData.search)"
ng-model-onblur>
</div>
</label>
</div>

View file

@ -86,8 +86,18 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
});
};
$scope.$on("$ionicView.beforeEnter", function(event, data){
$scope.formData = { search: null };
$scope.onQrCodeScanned = function(data) {
if (!incomingData.redir(data)) {
$ionicPopup.alert({
title: 'Invalid data',
});
}
};
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.formData = {
search: null
};
updateList();
});