I have a simple list with itemOptions defined for the items. Looks something like this:
<list animation="slide-in-up" option-buttons="itemButtons">
<item item="key" href="#/w/{{workoutId}}/e/{{key}}"
ng-repeat="(key, exercise) in workout.exercises">
<span class="name">
{{ exercise.name }}
</span>
<span class="numberOf" ng-pluralize count="countSets(exercise.sets)"
when="{'0': 'No sets', 'one': '1 set', 'other': '{} sets'}"></span>
</item>
</list>
$scope.itemButtons = [
{
text: 'Rename',
type: 'button-royal',
onTap: function(exercise, button) {
var newExerciseName = prompt("Rename exercise:", "");
if (newExerciseName) {
$scope.workout.exercises[exercise].name = newExerciseName;
$scope.workout.$save();
// or something, to close the modal
return true;
}
}
},
{
text: 'Delete',
type: 'button-assertive',
onTap: function(exercise, button) {
delete $scope.workout.exercises[exercise];
$scope.workout.$save();
}
}
]
Ideally what Iām looking to do is āslideā the list options back after a successful āRenameā action. Delete doesnāt have this issue, because the item is simply gone from the list. Is there a programmatic way to slide the menu back?