40 |
aurelien |
1 |
<!DOCTYPE html>
|
|
|
2 |
<html lang="en">
|
|
|
3 |
<head>
|
|
|
4 |
<meta charset="UTF-8" />
|
|
|
5 |
<title>jQuery UI Sortable - Portlets</title>
|
|
|
6 |
<link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
|
|
|
7 |
<script type="text/javascript" src="../../jquery-1.4.2.js"></script>
|
|
|
8 |
<script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
|
|
|
9 |
<script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
|
|
|
10 |
<script type="text/javascript" src="../../ui/jquery.ui.mouse.js"></script>
|
|
|
11 |
<script type="text/javascript" src="../../ui/jquery.ui.sortable.js"></script>
|
|
|
12 |
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
|
|
13 |
<style type="text/css">
|
|
|
14 |
.column { width: 170px; float: left; padding-bottom: 100px; }
|
|
|
15 |
.portlet { margin: 0 1em 1em 0; }
|
|
|
16 |
.portlet-header { margin: 0.3em; padding-bottom: 4px; padding-left: 0.2em; }
|
|
|
17 |
.portlet-header .ui-icon { float: right; }
|
|
|
18 |
.portlet-content { padding: 0.4em; }
|
|
|
19 |
.ui-sortable-placeholder { border: 1px dotted black; visibility: visible !important; height: 50px !important; }
|
|
|
20 |
.ui-sortable-placeholder * { visibility: hidden; }
|
|
|
21 |
</style>
|
|
|
22 |
<script type="text/javascript">
|
|
|
23 |
$(function() {
|
|
|
24 |
$(".column").sortable({
|
|
|
25 |
connectWith: '.column'
|
|
|
26 |
});
|
|
|
27 |
|
|
|
28 |
$(".portlet").addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all")
|
|
|
29 |
.find(".portlet-header")
|
|
|
30 |
.addClass("ui-widget-header ui-corner-all")
|
|
|
31 |
.prepend('<span class="ui-icon ui-icon-minusthick"></span>')
|
|
|
32 |
.end()
|
|
|
33 |
.find(".portlet-content");
|
|
|
34 |
|
|
|
35 |
$(".portlet-header .ui-icon").click(function() {
|
|
|
36 |
$(this).toggleClass("ui-icon-minusthick").toggleClass("ui-icon-plusthick");
|
|
|
37 |
$(this).parents(".portlet:first").find(".portlet-content").toggle();
|
|
|
38 |
});
|
|
|
39 |
|
|
|
40 |
$(".column").disableSelection();
|
|
|
41 |
});
|
|
|
42 |
</script>
|
|
|
43 |
</head>
|
|
|
44 |
<body>
|
|
|
45 |
<div class="demo">
|
|
|
46 |
|
|
|
47 |
<div class="column">
|
|
|
48 |
|
|
|
49 |
<div class="portlet">
|
|
|
50 |
<div class="portlet-header">Feeds</div>
|
|
|
51 |
<div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
|
|
|
52 |
</div>
|
|
|
53 |
|
|
|
54 |
<div class="portlet">
|
|
|
55 |
<div class="portlet-header">News</div>
|
|
|
56 |
<div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
|
|
|
57 |
</div>
|
|
|
58 |
|
|
|
59 |
</div>
|
|
|
60 |
|
|
|
61 |
<div class="column">
|
|
|
62 |
|
|
|
63 |
<div class="portlet">
|
|
|
64 |
<div class="portlet-header">Shopping</div>
|
|
|
65 |
<div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
|
|
|
66 |
</div>
|
|
|
67 |
|
|
|
68 |
</div>
|
|
|
69 |
|
|
|
70 |
<div class="column">
|
|
|
71 |
|
|
|
72 |
<div class="portlet">
|
|
|
73 |
<div class="portlet-header">Links</div>
|
|
|
74 |
<div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
|
|
|
75 |
</div>
|
|
|
76 |
|
|
|
77 |
<div class="portlet">
|
|
|
78 |
<div class="portlet-header">Images</div>
|
|
|
79 |
<div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
|
|
|
80 |
</div>
|
|
|
81 |
|
|
|
82 |
</div>
|
|
|
83 |
|
|
|
84 |
</div><!-- End demo -->
|
|
|
85 |
|
|
|
86 |
<div class="demo-description">
|
|
|
87 |
|
|
|
88 |
<p>
|
|
|
89 |
Enable portlets (styled divs) as sortables and use the <code>connectWith</code>
|
|
|
90 |
option to allow sorting between columns.
|
|
|
91 |
</p>
|
|
|
92 |
|
|
|
93 |
</div><!-- End demo-description -->
|
|
|
94 |
|
|
|
95 |
</body>
|
|
|
96 |
</html>
|