From f864d909f0e7325480357083ab660f8e291be5cb Mon Sep 17 00:00:00 2001 From: orweinberger Date: Fri, 13 Mar 2015 02:25:17 +0200 Subject: [PATCH] Progress --- www/css/style.css | 5 ++++ www/js/controllers.js | 42 ++++++++++++++++++++++++++++++++-- www/templates/tab-pockets.html | 6 ++++- 3 files changed, 50 insertions(+), 3 deletions(-) diff --git a/www/css/style.css b/www/css/style.css index 58b3b73..3e26274 100644 --- a/www/css/style.css +++ b/www/css/style.css @@ -48,7 +48,12 @@ .btn-addpocket { background-color: #dd4b39; border-color: #d43f3a; +} +.btn-rootinfo { + background-color:#ecf0f1; + border-color:#f2f2f2; + color:#222; } .btn-addpocket:hover, .btn-addpocket:focus, .btn-addpocket:active { diff --git a/www/js/controllers.js b/www/js/controllers.js index 8ba66a9..27b2f5b 100644 --- a/www/js/controllers.js +++ b/www/js/controllers.js @@ -124,6 +124,29 @@ angular.module('starter.controllers', []) else $state.go('tab.pocket-details', {pocketName: pocketName}); }; + $scope.pocketHold = function(pocketName) { + var myPopup = $ionicPopup.alert({ + template: "
Delete?
", + scope: $scope, + buttons: [ + {text: 'Cancel'}, + { + text: 'Delete', + type: 'button-positive', + onTap: function() { + return true + } + } + ] + }); + myPopup.then(function(res) { + if (res) { + engine.pockets.delete({name: pocketName}).then(function() { + + }); + } + }); + }; $scope.addPocket = function () { $scope.newpocket = {}; var myPopup = $ionicPopup.show({ @@ -186,10 +209,25 @@ angular.module('starter.controllers', []) throw err; }); }); - } + }; + $scope.rootInfo = function () { + var myPopup = $ionicPopup.show({ + template: '
QR
', + title: 'Info', + scope: $scope, + buttons: [ + { + text: 'OK', + type: 'button-positive' + } + ] + }); + myPopup.then(function (res) { + + }); + }; }) .controller('pocketDetailsCtrl', function ($scope, $state, $stateParams) { - $ }) .controller('DashCtrl', function ($scope) { diff --git a/www/templates/tab-pockets.html b/www/templates/tab-pockets.html index 79db1a4..c541ecf 100644 --- a/www/templates/tab-pockets.html +++ b/www/templates/tab-pockets.html @@ -1,7 +1,7 @@
-
@@ -14,6 +14,10 @@
+
+ +