angular-multiple-selection
Version:
Multiple Selection module for AngularJS
73 lines (60 loc) • 2.66 kB
HTML
<html ng-app="app">
<head>
<title>Angular Multiple Selection Demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.9/angular.min.js"></script>
<script type="text/javascript" src="multiple-selection.min.js"></script>
<script type="text/javascript">
angular.module('app', ['multipleSelection']);
</script>
<style type="text/css">
.row {
width: 100%;
overflow: hidden;
/* disable selection */
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.item_container {
border: 1px solid #ccc;
padding: 10px;
}
.item_container div {
width: 33%
}
.select-helper {
position: absolute;
border: 1px dashed red;
background: red;
opacity: 0.2;
}
.selected {
background-color: green ;
}
.selecting {
background-color: yellow ;
}
</style>
</head>
<body>
<div class="container-fluid">
<h1>Angular Multiple Selection Module</h1>
<i>Simple way to make your element selectable</i>
For single selection you can use mouse click. For multiple selection you can use Ctrl + Mouse click or Mouse dragging. Try it`s easy.
<h2>Simple demo</h2>
<div class="row item_container" multiple-selection-zone>
<div multiple-selection-item class="well" ng-class="{'selecting': isSelecting ,'selected': isSelected}">Lorem ipsum dolor sit amet alias, sint magni?</div>
<div multiple-selection-item class="well" ng-class="{'selecting': isSelecting ,'selected': isSelected}">Lorem ipsum dolor sit amet ad mollitia fugiat minima.</div>
<div multiple-selection-item class="well" ng-class="{'selecting': isSelecting ,'selected': isSelected}">Lorem ipsum dolor sit amet autem!</div>
<div multiple-selection-item class="well" ng-class="{'selecting': isSelecting ,'selected': isSelected}">Lorem ipsum dolor sit amet beatae.</div>
<div multiple-selection-item class="well" ng-class="{'selecting': isSelecting ,'selected': isSelected}">Lorem ipsum dolor sit amet. Iure vitae temporibus maiores perspiciatis!</div>
</div>
</div>
</body>
</html>