diff --git a/include/controllers/default/crunchbutton/connectionerror/index.php b/include/controllers/default/crunchbutton/connectionerror/index.php
deleted file mode 100644
index 870f815ea..000000000
--- a/include/controllers/default/crunchbutton/connectionerror/index.php
+++ /dev/null
@@ -1,7 +0,0 @@
-display('connectionerror/index');
- }
-}
\ No newline at end of file
diff --git a/include/views/default/crunchbutton/connectionerror/index.phtml b/include/views/default/crunchbutton/connectionerror/index.phtml
deleted file mode 100644
index da7bfb22d..000000000
--- a/include/views/default/crunchbutton/connectionerror/index.phtml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- No internet for you!
-
\ No newline at end of file
diff --git a/include/views/default/crunchbutton/frontend/connection.error.phtml b/include/views/default/crunchbutton/frontend/connection.error.phtml
new file mode 100644
index 000000000..9dc90712b
--- /dev/null
+++ b/include/views/default/crunchbutton/frontend/connection.error.phtml
@@ -0,0 +1,3 @@
+
+ Sorry no internet connection!
+
\ No newline at end of file
diff --git a/include/views/default/crunchbutton/frontend/connectionerror.phtml b/include/views/default/crunchbutton/frontend/connectionerror.phtml
deleted file mode 100644
index 1f47264c0..000000000
--- a/include/views/default/crunchbutton/frontend/connectionerror.phtml
+++ /dev/null
@@ -1,5 +0,0 @@
- if (!$this->export) : ?>
-
- else : ?>
- =$this->display('connectionerror/index')?>
- endif ; ?>
\ No newline at end of file
diff --git a/include/views/default/crunchbutton/layout/html.body.phtml b/include/views/default/crunchbutton/layout/html.body.phtml
index 140733462..654de7b23 100644
--- a/include/views/default/crunchbutton/layout/html.body.phtml
+++ b/include/views/default/crunchbutton/layout/html.body.phtml
@@ -183,5 +183,6 @@
+
diff --git a/www/assets/css/style.css b/www/assets/css/style.css
index c036944bf..891c391b2 100644
--- a/www/assets/css/style.css
+++ b/www/assets/css/style.css
@@ -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;
}
-}
-
+}
\ No newline at end of file
diff --git a/www/assets/js/app.js b/www/assets/js/app.js
index 77e806adf..108211288 100644
--- a/www/assets/js/app.js
+++ b/www/assets/js/app.js
@@ -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 );
}
-}
\ No newline at end of file
+}
+
+// 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();
+ }
+}
+
+
+
diff --git a/www/assets/js/controllers.js b/www/assets/js/controllers.js
index 9edf8ca5c..b7e4dc80a 100644
--- a/www/assets/js/controllers.js
+++ b/www/assets/js/controllers.js
@@ -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( '/' );
});
\ No newline at end of file