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 --> <!-- Main content -->
<ion-side-menu-content> <ion-side-menu-content on-drag="index.onDrag()">
<div notifications="right top"></div> <div notifications="right top"></div>
<div id="sectionContainer"> <div id="sectionContainer">
<div id="mainSection"> <div id="mainSection">

View file

@ -31,7 +31,7 @@
</button> </button>
</div> </div>
<div class="half-row left"> <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> <span class="size-12" translate>Confirm</span>
</button> </button>
</div> </div>

View file

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

View file

@ -1,6 +1,6 @@
'use strict'; '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 self = this;
var SOFT_CONFIRMATION_LIMIT = 12; var SOFT_CONFIRMATION_LIMIT = 12;
var errors = bwcService.getErrors(); var errors = bwcService.getErrors();
@ -69,6 +69,11 @@ angular.module('copayApp.controllers').controller('indexController', function($r
go.walletHome(); go.walletHome();
}; };
self.onDrag = function() {
if (!isCordova)
$ionicSideMenuDelegate.canDragContent(false);
};
self.hideBalance = function() { self.hideBalance = function() {
storageService.getHideBalanceFlag(self.walletId, function(err, shouldHideBalance) { storageService.getHideBalanceFlag(self.walletId, function(err, shouldHideBalance) {
if (err) self.shouldHideBalance = false; if (err) self.shouldHideBalance = false;

View file

@ -1,6 +1,6 @@
'use strict'; '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 isCordova = platformInfo.isCordova;
var isWP = platformInfo.isWP; var isWP = platformInfo.isWP;
@ -32,20 +32,6 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
ret.sendMaxInfo = {}; ret.sendMaxInfo = {};
var vanillaScope = ret; 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) { var disableScannerListener = $rootScope.$on('dataScanned', function(event, data) {
self.setForm(data); self.setForm(data);
$rootScope.$emit('Local/SetTab', 'send'); $rootScope.$emit('Local/SetTab', 'send');