-
-
Save gist-master/90d5fefd37ee4a406e8078fd93650e02 to your computer and use it in GitHub Desktop.
Sortable: basic usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<require from="./basic-use.css!css"></require> | |
<require from="aurelia-kendoui-bridge/sortable/sortable"></require> | |
<div id="example"> | |
<div id="playlist"> | |
<div id="playlist-title"><span>My Playlist</span></div> | |
<ul id="sortable-basic" ak-sortable="k-cursor-offset.bind: {top: -10, left: -230}; k-hint.call: hint($event); k-placeholder.call: placeholder($event);"> | |
<li class="sortable">Papercut <span>3:04</span></li> | |
<li class="sortable">One Step Closer <span>2:35</span></li> | |
<li class="sortable">With You <span>3:23</span></li> | |
<li class="sortable">Points of Authority <span>3:20</span></li> | |
<li class="sortable">Crawling <span>3:29</span></li> | |
<li class="sortable">Runaway <span>3:03</span></li> | |
<li class="sortable">By Myself <span>3:09</span></li> | |
<li class="sortable">In the End <span>3:36</span></li> | |
<li class="sortable">A Place for My Head <span>3:04</span></li> | |
<li class="sortable">Forgotten <span>3:14</span></li> | |
<li class="sortable">Cure for the Itch <span>2:37</span></li> | |
<li class="sortable">Pushing Me Away <span>3:11</span></li> | |
</ul> | |
</div> | |
</div> | |
</template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class BasicUse { | |
hint(e) { | |
return $(e).clone().addClass('sortable-basic-use-hint'); | |
} | |
placeholder(e) { | |
return $(e).clone().addClass('sortable-basic-use-placeholder').text('drop here'); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#example { | |
-webkit-user-select: none; | |
-moz-user-select: none; | |
-ms-user-select: none; | |
user-select: none; | |
} | |
#playlist { | |
margin: 30px auto; | |
width: 300px; | |
background-color: #f3f5f7; | |
border-radius: 4px; | |
border: 1px solid rgba(0,0,0,.1); | |
} | |
#playlist-title { | |
height: 80px; | |
background: url('https://demos.telerik.com/kendo-ui/content/web/sortable/playlist.png') no-repeat 50% 50% #ffffff; | |
border-radius: 4px 4px 0 0; | |
border-bottom: 1px solid rgba(0,0,0,.1); | |
} | |
#playlist-title span { | |
display: none; | |
} | |
#sortable-basic { | |
padding: 0; | |
margin: 0; | |
} | |
li.sortable { | |
list-style-type: none; | |
padding: 6px 8px; | |
margin: 0; | |
color: #666; | |
font-size: 1.2em; | |
cursor: move; | |
} | |
li.sortable:last-child { | |
border-bottom: 0; | |
border-radius: 0 0 4px 4px; | |
} | |
li.sortable span { | |
display: block; | |
float: right; | |
color: #666; | |
} | |
li.sortable:hover { | |
background-color: #dceffd; | |
} | |
li.sortable-basic-use-hint { | |
display: block; | |
width: 200px; | |
background-color: #52aef7; | |
color: #fff; | |
} | |
li.sortable-basic-use-hint:after { | |
content: ""; | |
display: block; | |
width: 0; | |
height: 0; | |
border-top: 6px solid transparent; | |
border-bottom: 6px solid transparent; | |
border-left: 6px solid #52aef7; | |
position: absolute; | |
left: 216px; | |
top: 8px; | |
} | |
li.sortable-basic-use-hint:last-child { | |
border-radius: 4px; | |
} | |
li.sortable-basic-use-hint span { | |
color: #fff; | |
} | |
li.sortable-basic-use-placeholder { | |
background-color: #dceffd; | |
color: #52aef7; | |
text-align: right; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>Aurelia KendoUI bridge</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.2.714/styles/kendo.common.min.css"> | |
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.2.714/styles/kendo.rtl.min.css"> | |
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.2.714/styles/kendo.default.min.css"> | |
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.2.714/styles/kendo.mobile.all.min.css"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.4.0/bluebird.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/chroma-js/1.2.1/chroma.min.js"></script> | |
<script src="https://kendo.cdn.telerik.com/2016.2.714/js/jquery.min.js"></script> | |
<script src="https://kendo.cdn.telerik.com/2016.2.714/js/jszip.min.js"></script> | |
<script src="https://kendo.cdn.telerik.com/2016.2.714/js/kendo.all.min.js"></script> | |
</head> | |
<body aurelia-app="main"> | |
<h1>Loading...</h1> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.6/system.js"></script> | |
<script src="https://rawgit.com/aurelia-ui-toolkits/aurelia-kendoui-bundles/1.0.0-beta.1.0.6/config2.js"></script> | |
<script> | |
System.import('aurelia-bootstrapper'); | |
</script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function configure(aurelia) { | |
aurelia.use | |
.standardConfiguration() | |
.developmentLogging() | |
.plugin('aurelia-kendoui-bridge'); | |
aurelia.start().then(a => a.setRoot()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment