Merge pull request #46 from gabrielbazan7/fix/SideBarDrag1

side bar drag and pull to refresh only available on mobile devices
This commit is contained in:
Javier Donadío 2016-06-06 15:09:48 -03:00
commit 99a4438aa3
5 changed files with 12 additions and 20 deletions

View File

@ -25,7 +25,7 @@
<!-- Main content -->
<ion-side-menu-content>
<ion-side-menu-content on-drag="index.onDrag()">
<div notifications="right top"></div>
<div id="sectionContainer">
<div id="mainSection">

View File

@ -31,7 +31,7 @@
</button>
</div>
<div class="half-row left">
<button ng-click="accept()" class="round expand" ng-style="{'background-color':index.backgroundColor}" translate>
<button ng-click="accept()" class="round expand" ng-style="{'background-color':index.backgroundColor}">
<span class="size-12" translate>Confirm</span>
</button>
</div>

View File

@ -53,9 +53,10 @@
-->
<ion-content id="walletHome" class="walletHome tab-view tab-in" scroll="false">
<ion-content overflow-scroll="true" delegate-handle="transactions" on-scroll="freezeScroll()">
<ion-content id="walletHome" class="walletHome tab-view tab-in" scroll="false" >
<ion-content overflow-scroll="true">
<ion-refresher
ng-if="index.isCordova"
pulling-icon="ion-ios-refresh"
spinner="ios-small"
on-refresh="index.updateAll({triggerTxUpdate: true})">

View File

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('indexController', function($rootScope, $scope, $log, $filter, $timeout, $ionicScrollDelegate, $ionicPopup, latestReleaseService, feeService, bwcService, pushNotificationsService, lodash, go, profileService, configService, rateService, storageService, addressService, gettext, gettextCatalog, amMoment, addonManager, bwsError, txFormatService, uxLanguage, glideraService, coinbaseService, platformInfo, addressbookService, walletService) {
angular.module('copayApp.controllers').controller('indexController', function($rootScope, $scope, $log, $filter, $timeout, $ionicSideMenuDelegate, $ionicScrollDelegate, $ionicPopup, latestReleaseService, feeService, bwcService, pushNotificationsService, lodash, go, profileService, configService, rateService, storageService, addressService, gettext, gettextCatalog, amMoment, addonManager, bwsError, txFormatService, uxLanguage, glideraService, coinbaseService, platformInfo, addressbookService, walletService) {
var self = this;
var SOFT_CONFIRMATION_LIMIT = 12;
var errors = bwcService.getErrors();
@ -69,6 +69,11 @@ angular.module('copayApp.controllers').controller('indexController', function($r
go.walletHome();
};
self.onDrag = function() {
if (!isCordova)
$ionicSideMenuDelegate.canDragContent(false);
};
self.hideBalance = function() {
storageService.getHideBalanceFlag(self.walletId, function(err, shouldHideBalance) {
if (err) self.shouldHideBalance = false;

View File

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('walletHomeController', function($scope, $ionicScrollDelegate, $ionicSideMenuDelegate, $rootScope, $interval, $timeout, $filter, $modal, $log, $ionicModal, notification, txStatus, profileService, lodash, configService, rateService, storageService, bitcore, gettext, gettextCatalog, platformInfo, addressService, ledger, bwsError, confirmDialog, txFormatService, animationService, addressbookService, go, feeService, walletService, fingerprintService, nodeWebkit) {
angular.module('copayApp.controllers').controller('walletHomeController', function($scope, $rootScope, $interval, $timeout, $filter, $modal, $log, $ionicModal, notification, txStatus, profileService, lodash, configService, rateService, storageService, bitcore, gettext, gettextCatalog, platformInfo, addressService, ledger, bwsError, confirmDialog, txFormatService, animationService, addressbookService, go, feeService, walletService, fingerprintService, nodeWebkit) {
var isCordova = platformInfo.isCordova;
var isWP = platformInfo.isWP;
@ -32,20 +32,6 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
ret.sendMaxInfo = {};
var vanillaScope = ret;
$scope.freezeScroll = function() {
var openRatio = $ionicSideMenuDelegate.getOpenRatio();
if (openRatio != 0)
$ionicScrollDelegate.$getByHandle('transactions').freezeScroll(true);
else
$ionicScrollDelegate.$getByHandle('transactions').freezeScroll(false);
$timeout(function() {
$scope.$apply();
});
};
var disableScannerListener = $rootScope.$on('dataScanned', function(event, data) {
self.setForm(data);
$rootScope.$emit('Local/SetTab', 'send');