Skip to content

Commit

Permalink
Resolved #74
Browse files Browse the repository at this point in the history
Bug +workaround documented here:
ionic-team/ionic-framework#2817
  • Loading branch information
eliabruni committed Apr 11, 2015
1 parent 23de0f8 commit cdeffeb
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 64 deletions.
1 change: 1 addition & 0 deletions www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ angular.module('splash',
$cordovaFacebookProvider.setAppID(appID, version);
}

// Android native scrolling
if(ionic.Platform.isAndroid()) $ionicConfigProvider.scrolling.jsScrolling(false);

// Ionic uses AngularUI Router which uses the concept of states
Expand Down
23 changes: 11 additions & 12 deletions www/js/ctrls/tab-account.ctrl.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
angular.module('splash.tabAccount.ctrl', [])


.controller('TabAccountCtrl', function($rootScope, $scope, $q, $state, $ionicModal, $ionicLoading,
.controller('TabAccountCtrl', function($scope, $q, $state, $ionicModal, $ionicLoading,
$ionicPopup, $cordovaFacebook, $cordovaFile,
$cordovaGeolocation, $localstorage, $cordovaGoogleAnalytics, $profile) {

Expand Down Expand Up @@ -41,22 +41,22 @@ angular.module('splash.tabAccount.ctrl', [])


//EXPERIMENTAL
$scope.retrieveActualCities = function() {
$profile.getCities()
.then(function(success) {

var cities = success;
})
}
//$scope.retrieveActualCities = function() {
// $profile.getCities()
// .then(function(success) {
//
// var cities = success;
// })
//}
//EXPERIMENTAL


$ionicModal.fromTemplateUrl('templates/cityModal.html', function(modal) {
$scope.cityModalCtrl = modal;
}, {
scope: $scope,
animation: 'slide-in-up',
focusFirstInput: true
scope: $scope
//animation: 'slide-in-up',
//focusFirstInput: true
});

$scope.modalData = { msg : {value: $scope.cities[0].value} };
Expand All @@ -65,7 +65,6 @@ angular.module('splash.tabAccount.ctrl', [])
clientSide: $scope.cities[0].value
};


$scope.openModal = function() {
$scope.cityModalCtrl.show();
};
Expand Down
7 changes: 6 additions & 1 deletion www/js/ctrls/tab-events.ctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ angular.module('splash.tabEvents.ctrl', [])
$cordovaGoogleAnalytics.trackView('Events');
});

$scope.events = Events.all();
// workaround for bug (check https://github.com/driftyco/ionic/issues/2817)
$scope.$on('$ionicView.beforeEnter', function() {
$ionicSlideBoxDelegate.update();
});

$scope.events = Events.all();

$scope.doRefresh = function() {
setTimeout(function() {

Expand Down
27 changes: 18 additions & 9 deletions www/js/services/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ angular.module('splash.events', [])
{
id: 0,
name:'dancing event',
image: 'url(img/event1.jpg)',
backImage: 'url(img/event1.jpg)',
image: 'img/event1.jpg',
date : 'DIC 25',
users: ['313'],
posSwipes : 0,
Expand All @@ -64,7 +65,8 @@ angular.module('splash.events', [])
{
id: 1,
name:'disco event',
image: 'url(img/event2.jpg)',
backImage: 'url(img/event2.jpg)',
image: 'img/event2.jpg',
date : 'DIC 25',
users: ['313', '314'],
posSwipes : 0,
Expand All @@ -73,7 +75,8 @@ angular.module('splash.events', [])
{
id: 2,
name:'electro event',
image: 'url(img/event3.jpg)',
backImage: 'url(img/event3.jpg)',
image: 'img/event3.jpg',
date : 'DIC 25',
users: ['313', '314', '315'],
posSwipes : 0,
Expand All @@ -82,7 +85,8 @@ angular.module('splash.events', [])
{
id: 3,
name:'dancing event',
image: 'url(img/event1.jpg)',
backImage: 'url(img/event1.jpg)',
image: 'img/event1.jpg',
date : 'DIC 25',
users: ['313'],
posSwipes : 0,
Expand All @@ -92,7 +96,8 @@ angular.module('splash.events', [])
{
id: 4,
name:'disco event',
image: 'url(img/event2.jpg)',
backImage: 'url(img/event2.jpg)',
image: 'img/event2.jpg',
date : 'DIC 25',
users: ['313', '314'],
posSwipes : 0,
Expand All @@ -101,7 +106,8 @@ angular.module('splash.events', [])
{
id: 5,
name:'electro event',
image: 'url(img/event3.jpg)',
backImage: 'url(img/event3.jpg)',
image: 'img/event3.jpg',
date : 'DIC 25',
users: ['313', '314', '315'],
posSwipes : 0,
Expand All @@ -110,7 +116,8 @@ angular.module('splash.events', [])
{
id: 6,
name:'dancing event',
image: 'url(img/event1.jpg)',
backImage: 'url(img/event1.jpg)',
image: 'img/event1.jpg',
date : 'DIC 25',
users: ['313'],
posSwipes : 0,
Expand All @@ -120,7 +127,8 @@ angular.module('splash.events', [])
{
id: 7,
name:'disco event',
image: 'url(img/event2.jpg)',
backImage: 'url(img/event2.jpg)',
image: 'img/event2.jpg',
date : 'DIC 25',
users: ['313', '314'],
posSwipes : 0,
Expand All @@ -129,7 +137,8 @@ angular.module('splash.events', [])
{
id: 8,
name:'electro event',
image: 'url(img/event3.jpg)',
backImage: 'url(img/event3.jpg)',
image: 'img/event3.jpg',
date : 'DIC 25',
users: ['313', '314', '315'],
posSwipes : 0,
Expand Down
2 changes: 1 addition & 1 deletion www/templates/eventDetail.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}">

</ion-header-bar>
<ion-content class="padding" ng-style="{'background-color':'#32506d'}">
<ion-content class="padding" ng-style="{'background-color':'#fff'}">
<!-- <img ng-src="{{event.image}}" style="width: 64px; height: 64px">
<h3>Notes</h3>
<p>
Expand Down
68 changes: 34 additions & 34 deletions www/templates/tab-account.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,40 +52,40 @@

<!--CITY SELECTOR-->

<div id="city-event-block" ng-style="{
'margin-top': buttonBoxMarginTop
}">

<div class="item item-input item-select"
ng-style="{
'height': buttonHeight,
'width': buttonBoxWidth,
'margin-left': 'auto',
'margin-right': 'auto',
'color': 'white',
'border':'none',
'background-color': '#062142',
'border-radius' : buttonBorderRadius
}">
<div class="input-label"
ng-style="{
'color': 'white',
'background-color': '#062142'
}">
City
</div>
<select ng-model="city"
ng-init="city=cities[myCity.id]"
ng-options="city.name for city in cities"
ng-change="updateCity(city)"
ng-style="{
'background-color': '#062142',
'color': 'white'
}">

</select>
</div>
</div>
<!--<div id="city-event-block" ng-style="{-->
<!--'margin-top': buttonBoxMarginTop-->
<!--}">-->

<!--<div class="item item-input item-select"-->
<!--ng-style="{-->
<!--'height': buttonHeight,-->
<!--'width': buttonBoxWidth,-->
<!--'margin-left': 'auto',-->
<!--'margin-right': 'auto',-->
<!--'color': 'white',-->
<!--'border':'none',-->
<!--'background-color': '#062142',-->
<!--'border-radius' : buttonBorderRadius-->
<!--}">-->
<!--<div class="input-label"-->
<!--ng-style="{-->
<!--'color': 'white',-->
<!--'background-color': '#062142'-->
<!--}">-->
<!--City-->
<!--</div>-->
<!--<select ng-model="city"-->
<!--ng-init="city=cities[myCity.id]"-->
<!--ng-options="city.name for city in cities"-->
<!--ng-change="updateCity(city)"-->
<!--ng-style="{-->
<!--'background-color': '#062142',-->
<!--'color': 'white'-->
<!--}">-->

<!--</select>-->
<!--</div>-->
<!--</div>-->

<!--EVENT CATEGORIES SELECTOR-->

Expand Down
11 changes: 4 additions & 7 deletions www/templates/tab-events.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@

<ion-refresher on-refresh="doRefresh()"></ion-refresher>

<div class="list">

<a class="event"
<a
ng-repeat="event in events"
href="#/app/event/{{event.id}}"
ng-style="{
Expand All @@ -41,7 +39,7 @@
<!--<div class="bio">-->
<button class="col button button-event"
ng-style="{
'background-image': event.image,
'background-image': event.backImage,
'background-size': backgroundSize,
'background-repeat':'no-repeat',
'height' : cardHeight
Expand All @@ -63,7 +61,6 @@


</a>
</div>

</ion-content>

Expand Down Expand Up @@ -92,7 +89,7 @@
<!--<div class="bio">-->
<button class="col button button-event"
ng-style="{
'background-image': event.image,
'background-image': event.backImage,
'background-size': backgroundSize,
'background-repeat':'no-repeat',
'height' : cardHeight
Expand Down Expand Up @@ -142,7 +139,7 @@
<!--<div class="bio">-->
<button class="col button button-event"
ng-style="{
'background-image': event.image,
'background-image': event.backImage,
'background-size': backgroundSize,
'background-repeat':'no-repeat',
'height' : cardHeight
Expand Down

0 comments on commit cdeffeb

Please sign in to comment.