Files
2013-10-16 11:22:01 -05:00

149 lines
4.1 KiB
HTML

<html ng-app="navTest">
<head>
<meta charset="utf-8">
<title>List</title>
<!-- Sets initial viewport load and disables zooming -->
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="../../../../dist/css/ionic.css">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.2/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.2/angular-touch.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.2/angular-animate.js"></script>
<style>
.my-repeat-animation > .ng-enter,
.my-repeat-animation > .ng-leave,
.my-repeat-animation > .ng-move {
-webkit-transition: 0.2s linear all;
transition: 0.2s linear all;
position:relative;
}
.my-repeat-animation > .ng-enter {
left:-10px;
opacity:0;
}
.my-repeat-animation > .ng-enter.ng-enter-active {
left:0;
opacity:1;
}
.my-repeat-animation > .ng-leave {
left:0;
opacity:1;
}
.my-repeat-animation > .ng-leave.ng-leave-active {
left:-10px;
opacity:0;
}
.my-repeat-animation > .ng-move {
opacity:0.5;
}
.my-repeat-animation > .ng-move.ng-move-active {
opacity:1;
}
</style>
</head>
<body>
<content has-header="true" ng-controller="TestCtrl" class="reveal-animation">
<list is-editing="isEditingItems" on-refresh="refreshProjects()" animation="my-repeat-animation" delete-icon="icon-minus-circled" reorder-icon="icon-navicon">
<div class="list-refresher">
<div style="height: 100px; font-size: 30px; text-align: center">REFRESHING</div>
</div>
<list-item ng-repeat="item in items"
buttons="item.buttons"
can-delete="true"
can-reorder="true"
can-swipe="true"
on-delete="deleteProject(project)"
on-select="selectProject(project)">
{{item.text}}
<i class="{{item.icon}}"></i>
</list-item>
</list>
<button ng-click="edit()" class="button button-success">Edit</button>
</content>
<script src="../../../../dist/js/ionic.js"></script>
<script src="../../../../dist/js/ionic-angular.js"></script>
<script>
angular.module('navTest', ['ionic.ui.list', 'ngAnimate'])
.controller('TestCtrl', function($scope) {
var removeItem = function(item) {
// Remove ourselves
$scope.items.splice($scope.items.indexOf(item), 1);
};
$scope.refreshProjects = function() {
alert('refreshing!');
};
$scope.items = [
{
text: 'Item 1',
canDelete: true,
canSwipe: true,
canReorder: true,
icon: 'icon-chevron-right',
hide: false,
deleteItem: removeItem,
buttons: [{
text: 'Kill',
type: 'button-danger',
buttonClicked: removeItem,
}]
},
{
text: 'Item 2',
canDelete: true,
canSwipe: true,
canReorder: true,
icon: 'icon-chevron-right',
deleteItem: removeItem,
buttons: [{
text: 'Kill',
type: 'button-danger',
buttonClicked: removeItem,
}]
},
{
text: 'Item 3',
canDelete: true,
canSwipe: true,
canReorder: true,
icon: 'icon-chevron-right',
deleteItem: removeItem,
buttons: [{
text: 'Kill',
type: 'button-danger',
buttonClicked: removeItem,
}]
},
{
text: 'Item 4',
canDelete: true,
canSwipe: true,
canReorder: true,
icon: 'icon-chevron-right',
deleteItem: removeItem,
buttons: [{
text: 'Kill',
type: 'button-danger',
buttonClicked: removeItem,
}]
}
];
$scope.edit = function() {
$scope.isEditingItems = !$scope.isEditingItems;
}
});
</script>
</body>
</html>