Skip to content

Commit

Permalink
Changed behavior to match points 4 and 5 in story [meanjs#94]("https:…
Browse files Browse the repository at this point in the history
…//tree.taiga.io/project/patf-outset/us/94"). Moved the "Rename" button into the individual list items, and changed the "delete" button to have a different style
  • Loading branch information
Patrick Fowler committed Aug 3, 2015
1 parent 8c6eb14 commit 72a46ef
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 13 deletions.
5 changes: 3 additions & 2 deletions mobile/scss/base/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ $content-body-text: #9b9b9b;
$secondary-text-action: rgba(255, 255, 255, 0.6);
$white: #ffffff;
$tab-text: #807b84;
$danger: #B13E3E;

/** Context specific variables **/
$modal-primary-bg: $badge-green;
Expand All @@ -35,11 +36,11 @@ $signup-entry-value-text: $white;

$light: #fff !default;
$stable: #f8f8f8 !default;
$positive: #387ef5 !default;
$positive: $badge-green !default; //#387ef5 !default;
$calm: #11c1f3 !default;
$balanced: #33cd5f !default;
$energized: #ffc900 !default;
$assertive: #ef473a !default;
$assertive: $danger !default; // #ef473a !default;
$royal: #886aea !default;
$dark: #444 !default;

Expand Down
7 changes: 7 additions & 0 deletions mobile/scss/general/general.scss
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ body{
.button{
font-weight: bold;
border-width: 1px 0 0;
border-radius: 0 0 0 0 !important;

&.primary{
color: $modal-primary-text;
Expand All @@ -95,11 +96,17 @@ body{
color: $modal-secondary-text;
background-color: $modal-secondary-bg;
}

&.assertive {
color: $assertive;
background-color: $modal-secondary-bg;
}

&.button-block{
margin-top: 0;
margin-bottom: 0;
border-width: 1px 0 0;


.ico{
vertical-align: middle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,19 @@
return !object.checked;
};

vm.rename = function () {
vm.index = null;
vm.name = '';
vm.rename = function (selectedIndex) {
vm.index = selectedIndex;

vm.lockboxDocuments.docs.filter(function (object, index) {
if(object.checked) vm.index = index;
return object.checked;
});
if (vm.index === null || vm.index === undefined) {
vm.lockboxDocuments.docs.filter(function (object, index) {
if (object.checked) {
index = index;
}
return object.checked;
});
}

vm.name = vm.lockboxDocuments.docs[vm.index].name;

var renamePopup = $ionicPopup.show({
template: '<input type="text" class="rename-popup" ng-model="vm.name">',
Expand All @@ -61,7 +66,11 @@
});

renamePopup.then(function(res) {
if(res) vm.lockboxDocuments.docs[vm.index].name = res;
if(res) {
vm.lockboxDocuments.docs[vm.index].name = res;
}

vm.index = null;
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ <h3 class="title">Your lockbox will contain all your secure documents.</h3>
<strong>{{doc.name}}</strong>
<span>{{doc.created}}</span>
</div>
<button class="button button-small">View</button>
<button class="button button-small" ng-click="vm.rename($index)">Rename</button>
</li>
</ul>
</ion-scroll>
</ion-pane>
<ion-footer-bar>
<div class="button-bar action-buttons">
<button class="button secondary" ng-disabled="vm.deleteDisabled" ng-click="vm.showConfirm()">Delete</button>
<button class="button primary" ng-disabled="vm.renameDisabled" ng-click="vm.rename()">Rename</button>
<button class="button assertive" ng-disabled="vm.deleteDisabled" ng-show="!vm.deleteDisabled" ng-click="vm.showConfirm()">Delete</button>
</div>
</ion-footer-bar>
</ion-view>

0 comments on commit 72a46ef

Please sign in to comment.