|
@@ -32,8 +32,8 @@
|
|
|
if(tracklist_is_orderable){
|
|
|
track_list_container.sortable({
|
|
|
update: function(event, ui) {
|
|
|
- console.log('sort update : event', event);
|
|
|
- console.log('sort update : ui', ui);
|
|
|
+ // console.log('sort update : event', event);
|
|
|
+ // console.log('sort update : ui', ui);
|
|
|
|
|
|
$.each(event.target.children, function(index, val) {
|
|
|
var $item = $(val),
|
|
@@ -177,7 +177,7 @@
|
|
|
* @param control_type Control type - 'checkbox' or 'radio'.
|
|
|
*/
|
|
|
function addItemToTrackList(track_list_container, item_text, control_id, control_type, delta) {
|
|
|
- console.log('addItemToTrackList');
|
|
|
+ // console.log('addItemToTrackList');
|
|
|
var new_item = $('<li class="track-item" delta="'+ delta +'"><div class="term-reference-tree-button-move"></div>' + item_text + '<div class="term-reference-tree-button-delete"></div></li>');
|
|
|
new_item.data('control_id', control_id);
|
|
|
|
|
@@ -261,7 +261,10 @@
|
|
|
track_list_container.append(new_item);
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ $hiddenInput = $('#'+control_id).parent('.form-item').next('input[type=hidden]');
|
|
|
+ $hiddenInput.val(new_item.index());
|
|
|
+
|
|
|
track_list_container.sortable('refresh');
|
|
|
}
|
|
|
}
|