diff --git a/htmlUI/html/js/playlist.js b/htmlUI/html/js/playlist.js
index 918be0c5f..6c29d8279 100644
--- a/htmlUI/html/js/playlist.js
+++ b/htmlUI/html/js/playlist.js
@@ -2,21 +2,16 @@
$(document).ready(function() {
$('#search_results').find('tr').not('.blue_head').draggable({
- connectToSortable: 'ul#spl_sortable',
helper: 'clone'
});
+
$('#cc_right_panel').find('h1').click(function(){
$(this).siblings().toggle();
});
function movePLItem(event, ui) {
- var ul, li, newPos, oldPos, id_prefix, tag;
-
- tag = ui.item.get(0).tagName
-
- if( tag === "TR")
- return;
+ var ul, li, newPos, oldPos, id_prefix;
ul = $(this);
li = ui.item;
@@ -68,12 +63,27 @@ $(document).ready(function() {
var tr, id, ul;
ul = $(this);
- tr = ui.item;
+ tr = ui.helper;
+
+ if(tr.get(0).tagName === 'LI')
+ return;
+
id = tr.find("input").attr('name');
- ul.find('tr').remove();
+ hpopup('ui_handler.php?act=PL.addItem&id='+id);
- location.href='ui_handler.php?act=PL.addItem&id='+id;
+ /*
+ $.post('ui_handler.php',
+
+ { 'act': 'SPL.addItem', 'id': id },
+
+ function(data){
+ var x;
+ },
+
+ "json"
+ );
+ */
}
@@ -90,8 +100,9 @@ $(document).ready(function() {
//PL side bar editor.
$("#spl_sortable").sortable();
$("#spl_sortable" ).bind( "sortstop", movePLItem);
- $("#spl_sortable" ).bind( "sortreceive", addPLItem);
- //$("#spl_sortable" ).bind( "sortout", test);
+
+ $("#spl_sortable").droppable();
+ $("#spl_sortable" ).bind( "drop", addPLItem);
function removeCueInput(){
var span = $(this).parent();
diff --git a/htmlUI/templates/script/collector.js.tpl b/htmlUI/templates/script/collector.js.tpl
index 5241b4c06..7eb4b7809 100644
--- a/htmlUI/templates/script/collector.js.tpl
+++ b/htmlUI/templates/script/collector.js.tpl
@@ -16,12 +16,7 @@ function collector_submit(formname, action, script, name, width, height)
}
}
- if (href == '') return false;
-
- if (action === 'PL.addItem') {
- location.href='ui_handler.php?act='+ action + href;
- return;
- }
+ if (href == '') return false;
if (action == 'delete') {
{/literal}
diff --git a/htmlUI/ui_handler.php b/htmlUI/ui_handler.php
index 7ad39255f..351235134 100644
--- a/htmlUI/ui_handler.php
+++ b/htmlUI/ui_handler.php
@@ -315,11 +315,11 @@ switch ($_REQUEST['act']) {
case "PL.addItem":
if (isset($_REQUEST['id'])) {
- if ($uiHandler->PLAYLIST->addItem($_REQUEST['id']) !== FALSE) {
+ if ($uiHandler->PLAYLIST->addItem($_REQUEST['id']) === TRUE) {
$uiHandler->SCRATCHPAD->addItem($_REQUEST['id']);
}
}
- $uiHandler->PLAYLIST->setReload("ui_browser.php?id=&act=BROWSE");
+ $uiHandler->PLAYLIST->setReload();
break;
case "PL.setClipLength":
diff --git a/htmlUI/ui_playlist.class.php b/htmlUI/ui_playlist.class.php
index d38066792..73bffe872 100644
--- a/htmlUI/ui_playlist.class.php
+++ b/htmlUI/ui_playlist.class.php
@@ -36,6 +36,7 @@ class uiPlaylist
$this->Base->redirUrl = $url;
else
$this->Base->redirUrl = $this->reloadUrl;
+
} // fn setReload