-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex_portlets.html
104 lines (83 loc) · 3.13 KB
/
index_portlets.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Sortable - Portlets</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<style>
body { min-width: 520px; }
.sort { width: 170px; float: left; padding-bottom: 100px; }
.portlet { margin: 0 1em 1em 0; float:left;}
.portlet-header { margin: 0.3em; padding-bottom: 4px; padding-left: 0.2em; }
.portlet-header .ui-icon { float: right; }
.portlet-content { padding: 0.4em; }
.ui-sortable-placeholder { border: 1px dotted black; visibility: visible !important; height: 50px !important; }
.ui-sortable-placeholder * { visibility: hidden; }
</style>
<script>
$(function() {
// $( ".sort" ).sortable({
// connectWith: ".sort"
// });
// // $( ".portlet" ).addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" )
// // .find( ".portlet-header" )
// // .addClass( "ui-widget-header ui-corner-all" )
// // .prepend( "<span class='ui-icon ui-icon-minusthick'></span>")
// // .end()
// // .find( ".portlet-content" );
// // $( ".portlet-header .ui-icon" ).click(function() {
// // $( this ).toggleClass( "ui-icon-minusthick" ).toggleClass( "ui-icon-plusthick" );
// // $( this ).parents( ".portlet:first" ).find( ".portlet-content" ).toggle();
// // });
// $( ".sort" ).disableSelection();
// });
function make_sortable(){
$('.sort').sortable({
//revert: true,
//placeholder: "drag-node node",
connectWith: ".sort"
//handle: ".handle"
}).disableSelection();
}
$('.button').click(function(e){
$('body').append('<ul class="sort"></ul>');
$('.sort').append('<li class="portlet"><div class="portlet-header">Images</div><div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div></li>');
make_sortable();
});
make_sortable();
});
</script>
</head>
<body>
<ul class="sort">
<li class="portlet">
<div class="portlet-header">Feeds</div>
<div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
</li>
<li class="portlet">
<div class="portlet-header">News</div>
<div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
</li>
</ul>
<ul class="sort">
<li class="portlet">
<div class="portlet-header">Shopping</div>
<div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
</li>
</ul>
<ul class="sort">
<li class="portlet">
<div class="portlet-header">Links</div>
<div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
</li>
<li class="portlet">
<div class="portlet-header">Images</div>
<div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
</li>
</ul>
<a class="button" href="#">Sort</a>
</body>
</html>