From ab7ad2c36c4848e189ecfce869f671e77aeb18d0 Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Wed, 26 Jun 2013 22:44:48 -0400 Subject: [PATCH] Fix #182 #183 #184 --- www/assets/js/callbacks.js | 22 ++++++++++++++++++---- www/assets/js/data.js | 4 +++- www/assets/js/util.js | 16 +++++++++------- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/www/assets/js/callbacks.js b/www/assets/js/callbacks.js index fd470401..39f97134 100644 --- a/www/assets/js/callbacks.js +++ b/www/assets/js/callbacks.js @@ -650,7 +650,7 @@ Callbacks = { queue: function(data) { // Wait until pending movements are completed - if(MOVING) { + if(PL_MOVING || PL_ADDING || PL_DELETING) { setTimeout(function() { Callbacks.queue(data); }, 100); @@ -699,11 +699,25 @@ Callbacks = { }, "delete": function(data) { + // Wait until any pending manipulation is finished + if(PL_MOVING || PL_ADDING || PL_DELETING) { + setTimeout(function() { + Callbacks["delete"](data); + }, 100); + return; + } var li = $("#queue").children()[data.position]; $(li).remove(); }, moveVideo: function(data) { + // Wait until any pending manipulation is finished + if(PL_MOVING || PL_ADDING || PL_DELETING) { + setTimeout(function() { + Callbacks.moveVideo(position); + }, 100); + return; + } if(data.from < POSITION && data.to >= POSITION) POSITION--; else if(data.from > POSITION && data.to <= POSITION) @@ -715,10 +729,10 @@ Callbacks = { }, setPosition: function(position) { - // Wait until any pending movement is finished - if(MOVING) { + // Wait until any pending manipulation is finished + if(PL_MOVING || PL_ADDING || PL_DELETING) { setTimeout(function() { - Callbacks.move(position); + Callbacks.setPosition(position); }, 100); return; } diff --git a/www/assets/js/data.js b/www/assets/js/data.js index 3b5070c9..53e81708 100644 --- a/www/assets/js/data.js +++ b/www/assets/js/data.js @@ -40,7 +40,9 @@ if($("#ytapiplayer").length > 0) { var VHEIGHT = ""+parseInt(parseInt(VWIDTH) * 9 / 16); } var POSITION = -1; -var MOVING = false; +var PL_MOVING = false; +var PL_ADDING = false; +var PL_DELETING = false; var REBUILDING = false; var socket = { emit: function() { diff --git a/www/assets/js/util.js b/www/assets/js/util.js index defcccc7..09d1acf2 100644 --- a/www/assets/js/util.js +++ b/www/assets/js/util.js @@ -259,8 +259,9 @@ function addQueueButtons(li) { } // Temp/Untemp if(hasPermission("settemp")) { + var tempstr = li.data("media").temp?"Make Permanent":"Make Temporary"; $("