Skip to content

Commit

Permalink
Progress
Browse files Browse the repository at this point in the history
  • Loading branch information
orweinberger committed Mar 13, 2015
1 parent 58c387c commit f864d90
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 3 deletions.
5 changes: 5 additions & 0 deletions www/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
42 changes: 40 additions & 2 deletions www/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: "<div>Delete?</div>",
scope: $scope,
buttons: [
{text: 'Cancel'},
{
text: '<b>Delete</b>',
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({
Expand Down Expand Up @@ -186,10 +209,25 @@ angular.module('starter.controllers', [])
throw err;
});
});
}
};
$scope.rootInfo = function () {
var myPopup = $ionicPopup.show({
template: '<div>QR</div>',
title: 'Info',
scope: $scope,
buttons: [
{
text: '<b>OK</b>',
type: 'button-positive'
}
]
});
myPopup.then(function (res) {

});
};
})
.controller('pocketDetailsCtrl', function ($scope, $state, $stateParams) {
$

})
.controller('DashCtrl', function ($scope) {
Expand Down
6 changes: 5 additions & 1 deletion www/templates/tab-pockets.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ion-view view-title="My pockets">
<ion-content>
<div class="pocket-content">
<div ng-repeat="(key, value) in pockets.pockets"
<div on-hold="pocketHold('{{value.name}}')" ng-repeat="(key, value) in pockets.pockets"
style="background-color:{{value.color}};width:100%;height:{{value.hard_ratio*100}}%; position:relative;"
ng-click="selectPocket('{{value.name}}', '{{value.pockets}}')">
<div class="pocket-title" style="background-color:{{value.color}}">
Expand All @@ -14,6 +14,10 @@
</div>
</div>
</ion-content>
<div style="position:absolute;top:50px; right: 8px;">
<button type="button" ng-click="rootInfo()" class="btn btn-primary btn-rootinfo btn-circle btn-lg"><i
class="fa fa-info"></i></button>
</div>
<div style="position:absolute;bottom:8px; right: 8px;">
<button type="button" ng-click="addPocket()" class="btn btn-primary btn-addpocket btn-circle btn-lg"><i
class="fa fa-plus"></i></button>
Expand Down

0 comments on commit f864d90

Please sign in to comment.