support wide screens

This commit is contained in:
Gabriel Bazán 2016-06-23 16:18:18 -03:00
commit 2c300d422e
7 changed files with 44 additions and 15 deletions

View file

@ -510,9 +510,34 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
})
.run(function($rootScope, $state, $location, $log, $timeout, $ionicPlatform, platformInfo, profileService, uxLanguage, go, gettextCatalog) {
if (platformInfo.isCordova) {
if (screen.width < 768) {
screen.lockOrientation('portrait');
} else {
window.addEventListener("orientationchange", function() {
var leftMenuWidth = document.querySelector("ion-side-menu[side='left']").clientWidth;
if (screen.orientation.includes('portrait')) {
// Portrait
document.querySelector("ion-side-menu-content").style.width = (screen.width - leftMenuWidth) + "px";
} else {
// Landscape
document.querySelector("ion-side-menu-content").style.width = (screen.height - leftMenuWidth) + "px";
}
});
}
} else {
if (screen.width >= 768) {
window.addEventListener('resize', function() {
$rootScope.$emit('Local/WindowResize');
});
}
}
$ionicPlatform.ready(function() {
if (platformInfo.isCordova) {
ionic.Platform.fullScreen(true, false);
$ionicPlatform.registerBackButtonAction(function(event) {
event.preventDefault();
}, 100);