CC-3174 : showbuilder

fixing some css/js for display.
This commit is contained in:
Naomi Aro 2012-02-01 23:33:20 +01:00
parent f5b2a23eb1
commit 3aab811a3e
11 changed files with 89 additions and 22 deletions

View file

@ -1,15 +1,12 @@
function fnLibraryTableRowCallback( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
$(nRow).attr("id", aData["row_id"]);
$(nRow).attr("id", aData["tr_id"]);
return nRow;
}
function fnLibraryTableDrawCallback() {
addLibraryItemEvents();
addMetadataQtip();
//saveNumEntriesSetting();
//setupGroupActions();
}
function addLibraryItemEvents() {

View file

@ -1,6 +1,6 @@
function fnLibraryTableRowCallback( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
$(nRow).attr("id", aData["id"]);
$(nRow).attr("id", aData["tr_id"]);
$(nRow).data("show_builder", {"id": aData["id"], "length": aData["length"]});
@ -15,7 +15,7 @@ function fnLibraryTableDrawCallback() {
function addLibraryItemEvents() {
$('#library_display tr')
$('#library_display tr:not(:first)')
.draggable({
helper: 'clone',
cursor: 'pointer',

View file

@ -318,6 +318,10 @@ function createDataTable(data) {
},
"fnRowCallback": fnLibraryTableRowCallback,
"fnDrawCallback": fnLibraryTableDrawCallback,
"fnHeaderCallback": function(nHead) {
$(nHead).find("input[type=checkbox]").attr("checked", false);
},
"aoColumns": [
/* Checkbox */ {"sTitle": "<input type='checkbox' name='pl_cb_all'>", "bSortable": false, "bSearchable": false, "mDataProp": "checkbox", "sWidth": "25px", "sClass": "library_checkbox"},
/* Id */ {"sName": "id", "bSearchable": false, "bVisible": false, "mDataProp": "id", "sClass": "library_id"},
@ -327,7 +331,7 @@ function createDataTable(data) {
/* Genre */ {"sTitle": "Genre", "sName": "genre", "mDataProp": "genre", "sWidth": "10%", "sClass": "library_genre"},
/* Year */ {"sTitle": "Year", "sName": "year", "mDataProp": "year", "sWidth": "8%", "sClass": "library_year"},
/* Length */ {"sTitle": "Length", "sName": "length", "mDataProp": "length", "sWidth": "10%", "sClass": "library_length"},
/* Type */ {"sTitle": "Type", "sName": "ftype", "bSearchable": false, "mDataProp": "image", "sWidth": "9%", "sClass": "library_type"},
/* Type */ {"sTitle": "", "sName": "ftype", "bSearchable": false, "mDataProp": "image", "sWidth": "25px", "sClass": "library_type"},
/* Upload Time */ {"sTitle": "Upload Time", "sName": "utime", "mDataProp": "utime", "sClass": "library_upload_time"},
/* Last Modified */ {"sTitle": "Last Modified", "sName": "mtime", "bVisible": false, "mDataProp": "mtime", "sClass": "library_modified_time"},
],
@ -340,7 +344,7 @@ function createDataTable(data) {
},
"iDisplayLength": getNumEntriesPreference(data),
// R = ColReorder, C = ColVis, see datatables doc for others
// R = ColReorder, C = ColVis, T = TableTools
"sDom": 'Rlfr<"H"T<"library_toolbar"C>>t<"F"ip>',
"oTableTools": {
@ -374,7 +378,12 @@ function createDataTable(data) {
"aiExclude": [0, 1, 2],
"sSize": "css",
"bShowAll": true
},
"oColReorder": {
"iFixedColumns": 1
}
});
oTable.fnSetFilteringDelay(350);

View file

@ -223,11 +223,18 @@ $(document).ready(function() {
"fnServerData": fnServerData,
"fnRowCallback": fnShowBuilderRowCallback,
"fnHeaderCallback": function(nHead) {
$(nHead).find("input[type=checkbox]").attr("checked", false);
},
"oColVis": {
"aiExclude": [ 0, 1 ]
},
"oColReorder": {
"iFixedColumns": 1
},
"oTableTools": {
"sRowSelect": "multi",
"aButtons": [],
@ -312,7 +319,7 @@ $(document).ready(function() {
placeholder: "placeholder show-builder-placeholder",
forceHelperSize: true,
forcePlaceholderSize: true,
items: 'tr:not(.show-builder-header):not(.show-builder-footer):not(.show-builder-not-allowed):not(.show-builder-empty)',
items: 'tr:not(:first):not(.show-builder-header):not(.show-builder-footer):not(.show-builder-not-allowed):not(.show-builder-empty)',
//cancel: ".show-builder-header .show-builder-footer",
receive: function(event, ui) {
var x;