Tweak movement

This commit is contained in:
calzoneman 2013-10-03 22:11:47 -05:00
parent 89422c3c1d
commit 6309e42989
5 changed files with 12 additions and 14 deletions

View File

@ -1,3 +1,9 @@
Thu Oct 03 22:09 2013 CDT
* www/assets/js/ui.js: Use sortable("cancel") to remove the need for
the `moveby` field of the movement packet
* www/assets/js/util.js, www/assets/js/callbacks.js, lib/channel.js:
Remove references to moveby
Thu Oct 03 22:05 2013 CDT Thu Oct 03 22:05 2013 CDT
* lib/channel.js, lib/playlist.js: Fix 'next' bumping not properly * lib/channel.js, lib/playlist.js: Fix 'next' bumping not properly
telling clients that the old item was deleted telling clients that the old item was deleted

View File

@ -1762,11 +1762,6 @@ Channel.prototype.move = function(data, user) {
return; return;
if (self.playlist.move(data.from, data.after)) { if (self.playlist.move(data.from, data.after)) {
var moveby = user && user.name ? user.name : null;
if (typeof data.moveby !== "undefined")
moveby = data.moveby;
var fromit = self.playlist.items.find(data.from); var fromit = self.playlist.items.find(data.from);
var afterit = self.playlist.items.find(data.after); var afterit = self.playlist.items.find(data.after);
var aftertitle = (afterit && afterit.media) var aftertitle = (afterit && afterit.media)
@ -1780,7 +1775,6 @@ Channel.prototype.move = function(data, user) {
self.sendAll("moveVideo", { self.sendAll("moveVideo", {
from: data.from, from: data.from,
after: data.after, after: data.after,
moveby: moveby
}); });
} }

View File

@ -867,13 +867,11 @@ Callbacks = {
}, },
moveVideo: function(data) { moveVideo: function(data) {
if (data.moveby != CLIENT.name) {
PL_ACTION_QUEUE.queue(function (plq) { PL_ACTION_QUEUE.queue(function (plq) {
playlistMove(data.from, data.after, function () { playlistMove(data.from, data.after, function () {
plq.release(); plq.release();
}); });
}); });
}
}, },
setCurrent: function(uid) { setCurrent: function(uid) {

View File

@ -316,6 +316,7 @@ $("#queue").sortable({
from: PL_FROM, from: PL_FROM,
after: PL_AFTER after: PL_AFTER
}); });
$("#queue").sortable("cancel");
} }
}); });
$("#queue").disableSelection(); $("#queue").disableSelection();

View File

@ -419,8 +419,7 @@ function addQueueButtons(li) {
.click(function() { .click(function() {
socket.emit("moveMedia", { socket.emit("moveMedia", {
from: li.data("uid"), from: li.data("uid"),
after: PL_CURRENT, after: PL_CURRENT
moveby: null
}); });
}) })
.appendTo(menu); .appendTo(menu);