Menu settings testing
This commit is contained in:
parent
fa55d4fee9
commit
6b627d50f9
@ -343,7 +343,8 @@ angular.module('starter', ['ionic','ngIOS9UIWebViewPatch','starter.controllers',
|
||||
url: "/pokemonlist",
|
||||
cache: true,
|
||||
params:{
|
||||
isAnimated:(ionic.Platform.isAndroid()==false)
|
||||
isAnimated:(ionic.Platform.isAndroid()==false),
|
||||
controllersettings: null
|
||||
},
|
||||
views: {
|
||||
'menuContent': {
|
||||
|
||||
@ -116,10 +116,10 @@ appControllers.controller('menuCtrl', function ($scope, $timeout, $mdUtil, $mdSi
|
||||
targetEvent: null,
|
||||
locals: {
|
||||
displayOption: {
|
||||
title: "Confirmation",
|
||||
content: "Do you want to close the application?",
|
||||
ok: "Confirm",
|
||||
cancel: "Cancel"
|
||||
title: "App beenden?",
|
||||
content: "Möchten Sie PokedexHelper wirklich beenden?",
|
||||
ok: "Ja",
|
||||
cancel: "Nein"
|
||||
}
|
||||
}
|
||||
}).then(function () {
|
||||
|
||||
@ -346,7 +346,7 @@
|
||||
<div class="footer-fab-bar">
|
||||
<a class="md-button md-accent md-fab fab-footer" ng-click="showListBottomSheet($event,contractForm)"
|
||||
aria-label="Contract Form Actions">
|
||||
<i class="ion-android-star"></i>
|
||||
<i class="ion-navicon-round"></i>
|
||||
</a>
|
||||
</div>
|
||||
<!--end Pokemon detail section-->
|
||||
@ -366,13 +366,21 @@
|
||||
</a>
|
||||
</md-list-item>
|
||||
|
||||
<md-list-item ng-show="actionDelete">
|
||||
<md-list-item>
|
||||
<a class="md-default-theme md-bottom-sheet-list-item"
|
||||
ng-click="deleteContract(contract,$event)">
|
||||
<i class="ion-android-delete"></i>
|
||||
<span>Als Lesezeichen speichern</span>
|
||||
</a>
|
||||
</md-list-item>
|
||||
|
||||
<md-list-item>
|
||||
<a class="md-default-theme md-bottom-sheet-list-item"
|
||||
ng-click="deleteContract(contract,$event)">
|
||||
<i class="ion-android-delete"></i>
|
||||
<span>Pokemon Bild setzen</span>
|
||||
</a>
|
||||
</md-list-item>
|
||||
<!--end md bottom sheet list item-->
|
||||
</md-list>
|
||||
</md-bottom-sheet>
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
</md-toolbar><!--end toolbar section-->
|
||||
|
||||
<!--pokemon list section-->
|
||||
<ion-content id="pokemon-list-content" class="fade-in">
|
||||
<ion-content id="pokemon-list-content">
|
||||
<!--list section-->
|
||||
<md-list>
|
||||
<!--Below code it will disable animation to better performance-->
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<!--State name : app.contractsetting-->
|
||||
<!--URL : #app/contractsetting-->
|
||||
|
||||
<ion-view title="SQLite Setting">
|
||||
<ion-view title="PokedexHelper - Einstellungen">
|
||||
<!--left button on navigation bar-->
|
||||
<ion-nav-buttons side="left">
|
||||
<a ng-click="$ionicGoBack()" class="button back-button buttons button-clear header-item nav-back-btn">
|
||||
@ -35,7 +35,7 @@
|
||||
|
||||
<p> Clear All Data</p>
|
||||
</md-list-item>
|
||||
<md-list-item class="md-list-item-default" ng-click="$ionicGoBack()">
|
||||
<md-list-item class="md-list-item-default" ng-click="navigateTo('app.pokemonlist', {isAnimated:false,controllersettings:{test:'Laola',refresh:'1'}})">
|
||||
<i class="ion-android-refresh"></i>
|
||||
|
||||
<p>Refresh Data</p>
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
// http://ngcordova.com/docs/plugins/sqlite/
|
||||
//
|
||||
// Controller of Pokemon List Page.
|
||||
appControllers.controller('pokemonListCtrl', function ($scope, $stateParams,$ionicScrollDelegate, $filter, $mdDialog, $timeout, $ionicModal, $state, $mdBottomSheet, pokedexDB) {
|
||||
appControllers.controller('pokemonListCtrl', function ($scope, $stateParams,$ionicScrollDelegate, $filter, $mdDialog, $timeout, $ionicModal, $state, $mdBottomSheet, $ionicHistory,pokedexDB) {
|
||||
|
||||
// initialForm is the first activity in the controller.
|
||||
// It will initial all variable data and let the function works when page load.
|
||||
@ -94,6 +94,17 @@ appControllers.controller('pokemonListCtrl', function ($scope, $stateParams,$ion
|
||||
$scope.initialForm();
|
||||
});
|
||||
|
||||
|
||||
$scope.$on('$ionicView.enter', function(viewInfo, state){
|
||||
console.log('ENTERED');
|
||||
$scope.controllersettings = $stateParams.controllersettings;
|
||||
if ($scope.controllersettings.refresh=='1'){
|
||||
console.log("refreshed");
|
||||
//$scope.initialForm();
|
||||
}
|
||||
console.debug($scope.controllersettings);
|
||||
});
|
||||
|
||||
});// End of Pokemon List Page Controller.
|
||||
|
||||
// Controller of pokemon Detail Page.
|
||||
@ -289,8 +300,6 @@ appControllers.controller('pokemonSettingCtrl', function ($scope,$ionicViewSwitc
|
||||
// For confirm button to remove all data.
|
||||
try {
|
||||
// Remove all data by calling pokedexDB.removeAll() service.
|
||||
pokedexDB.removeAll();
|
||||
$scope.pokemonsCount = [];
|
||||
//Showing toast for remove data is success.
|
||||
$mdToast.show({
|
||||
controller: 'toastController',
|
||||
@ -324,6 +333,10 @@ appControllers.controller('pokemonSettingCtrl', function ($scope,$ionicViewSwitc
|
||||
|
||||
};// End clear all data from sqlite
|
||||
|
||||
$scope.refreshData=function(){
|
||||
|
||||
};
|
||||
|
||||
// navigateTo is for navigate to other page
|
||||
// by using targetPage to be the destination state.
|
||||
// Parameter :
|
||||
@ -340,7 +353,8 @@ appControllers.controller('pokemonSettingCtrl', function ($scope,$ionicViewSwitc
|
||||
$ionicViewSwitcher.nextDirection('back');
|
||||
|
||||
$state.go(stateName, {
|
||||
isAnimated: objectData,
|
||||
isAnimated: objectData.isAnimated,
|
||||
controllersettings: objectData.controllersettings,
|
||||
});
|
||||
}
|
||||
}; // End of navigateTo.
|
||||
|
||||
@ -49,6 +49,10 @@ appServices.factory('pokedexDB', function ($cordovaSQLite)
|
||||
|
||||
return {
|
||||
// Select all data from sqlite
|
||||
refresh: function ()
|
||||
{
|
||||
return this.all();
|
||||
},
|
||||
all: function ()
|
||||
{
|
||||
pokemonList = [];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user