Sortable sidebar (experimental)

This commit is contained in:
Mattias Erming 2014-09-23 16:05:07 -07:00
parent ec3de9b9d3
commit d283c512d5
3 changed files with 41 additions and 7 deletions

View File

@ -127,7 +127,7 @@ button {
bottom: 52px; bottom: 52px;
left: 0; left: 0;
overflow: hidden; overflow: hidden;
overflow-y: auto; /*overflow-y: auto;*/
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
position: absolute; position: absolute;
top: 0; top: 0;
@ -149,13 +149,14 @@ button {
} }
#sidebar .networks { #sidebar .networks {
min-height: 100%; min-height: 100%;
padding: 20px 30px 40px; padding: 20px 30px 0;
} }
#sidebar .networks:empty { #sidebar .networks:empty {
padding: 0; padding: 0;
} }
#sidebar .network + .network { #sidebar .network,
margin-top: 30px; #sidebar .network-placeholder {
margin-bottom: 30px;
} }
#sidebar .empty { #sidebar .empty {
color: #9ca5b4; color: #9ca5b4;
@ -165,15 +166,19 @@ button {
padding: 20px 40px; padding: 20px 40px;
text-align: center; text-align: center;
} }
#sidebar .chan { #sidebar .chan,
#sidebar .chan-placeholder {
display: block; display: block;
margin: 1px -10px; margin: 1px -10px;
padding: 6px 10px 8px; padding: 6px 10px 8px;
position: relative; position: relative;
text-align: left; text-align: left;
transition: all .2s; transition: color .2s;
width: 180px; width: 180px;
} }
#sidebar .chan-placeholder {
padding-bottom: 10px;
}
#sidebar .chan:first-child { #sidebar .chan:first-child {
color: #84ce88; color: #84ce88;
font-size: 15px; font-size: 15px;

View File

@ -147,6 +147,8 @@ $(function() {
$("#footer").find(".connect").trigger("click"); $("#footer").find(".connect").trigger("click");
} }
} }
sortable();
}); });
socket.on("join", function(data) { socket.on("join", function(data) {
@ -221,6 +223,7 @@ $(function() {
.prop("disabled", false) .prop("disabled", false)
.end(); .end();
confirmExit(); confirmExit();
sortable();
}); });
socket.on("nick", function(data) { socket.on("nick", function(data) {
@ -671,6 +674,32 @@ $(function() {
return date; return date;
} }
function sortable() {
sidebar.sortable({
axis: "y",
containment: "parent",
cursor: "grabbing",
items: ".network",
handle: ".lobby",
placeholder: "network-placeholder",
forcePlaceholderSize: true,
update: function() {
// ..
}
});
sidebar.find(".network").sortable({
axis: "y",
containment: "parent",
cursor: "grabbing",
items: ".chan:not(.lobby)",
placeholder: "chan-placeholder",
forcePlaceholderSize: true,
update: function() {
// ..
}
});
}
document.addEventListener( document.addEventListener(
"visibilitychange", "visibilitychange",
function() { function() {

View File

@ -1,7 +1,7 @@
{ {
"name": "shout", "name": "shout",
"description": "A web IRC client", "description": "A web IRC client",
"version": "0.32.5", "version": "0.33.0",
"author": "Mattias Erming", "author": "Mattias Erming",
"preferGlobal": true, "preferGlobal": true,
"bin": { "bin": {