This commit is contained in:
pererinha 2013-09-21 20:05:25 -03:00
parent b4922d00d8
commit 1bf12d67a6
8 changed files with 54 additions and 20 deletions

View File

@ -1,7 +0,0 @@
<?php
class Controller_ConnectionError extends Cana_Controller {
public function init() {
Cana::view()->display('connectionerror/index');
}
}

View File

@ -1,3 +0,0 @@
<div class="main-content-readable">
No internet for you!
</div>

View File

@ -0,0 +1,3 @@
<div class="connection-error" ng-show="connectionError" ng-style="{width: windowWidth, height: windowHeight}">
<i class="icon-warning-sign"></i> Sorry no internet connection!
</div>

View File

@ -1,5 +0,0 @@
<? if (!$this->export) : ?>
<div ng-bind-html-unsafe="legal"></div>
<? else : ?>
<?=$this->display('connectionerror/index')?>
<? endif ; ?>

View File

@ -183,5 +183,6 @@
<div ng-include="'assets/view/giftcard.html'"></div>
<div ng-include="'assets/view/suggestion.html'"></div>
<div ng-include="'assets/view/support.html'"></div>
<div ng-include="'assets/view/connection.error.html'"></div>
<div id="fb-root"></div>

View File

@ -86,6 +86,18 @@ html[xmlns] .clearfix {
.unbold{
font-weight: normal !important;
}
.connection-error{
width:100%;
z-index:1000;
top:0;
left:0;
position:absolute;
background:#FFF;
height:100px;
padding-top: 10px;
text-align: center;
}
/* CUSTOM CHECKBOX */
.custom-checkbox{
background:url(../images/checkbox-unchecked.png);
@ -2846,5 +2858,4 @@ h1.about-header {
height: 125px;
width: 125px;
}
}
}

View File

@ -129,7 +129,7 @@ NGApp.config(['$routeProvider', '$locationProvider', function($routeProvider, $l
}]);
// global route change items
NGApp.controller('AppController', function ($scope, $route, $routeParams, $rootScope, $location, AccountService, MainNavigationService, AccountSignOut, CartService) {
NGApp.controller('AppController', function ($scope, $route, $routeParams, $rootScope, $location, $window, AccountService, MainNavigationService, AccountSignOut, CartService) {
// define external pointers
App.rootScope = $rootScope;
@ -259,7 +259,20 @@ NGApp.controller('AppController', function ($scope, $route, $routeParams, $rootS
}
});
// Make the window's size available to all scope
$rootScope.windowWidth = $window.outerWidth;
$rootScope.windowHeight = $window.outerHeight;
// Window resize event
angular.element( $window ).bind( 'resize',function(){
$rootScope.windowWidth = $window.outerWidth;
$rootScope.windowHeight = $window.outerHeight;
$rootScope.$apply( 'windowWidth' );
$rootScope.$apply( 'windowHeight' );
});
AccountService.checkUser();
});
App.alert = function(txt, title) {
@ -657,4 +670,20 @@ App.applyIOSPositionFix = function(){
}, 300 )
}, 200 );
}
}
}
// Methods used by phoneGap
App.noInternet = {
show: function(){
App.rootScope.connectionError = true;
App.rootScope.$safeApply();
},
hide : function(){
App.rootScope.connectionError = false;
App.rootScope.$safeApply();
location.reload();
}
}

View File

@ -742,9 +742,14 @@ NGApp.controller( 'NotificationAlertCtrl', function ( $scope, $rootScope ) {
});
});
NGApp.controller( 'InviteCtrl', function ( $scope, $routeParams, $location, ReferralService ) {
// Just store the cookie, it will be used later
$.cookie( 'referral', $routeParams.id );
$location.path( '/' );
});
NGApp.controller( 'NoInternetCtrl', function ( $scope ) {
// Just store the cookie, it will be used later
$.cookie( 'referral', $routeParams.id );
$location.path( '/' );
});