CC-6137 - datatables is the devil

This commit is contained in:
Duncan Sommerville 2015-09-10 16:47:36 -04:00
parent 3586845549
commit 2d2ed25fcc
6 changed files with 70 additions and 37 deletions

View file

@ -133,7 +133,7 @@ var AIRTIME = (function(AIRTIME) {
return container;
},
cursor: 'pointer',
cursor: 'move',
//cursorAt: {
// top: 30,
// right: 10
@ -173,7 +173,7 @@ var AIRTIME = (function(AIRTIME) {
return container;
},
cursor: 'pointer',
cursor: 'move',
//cursorAt: {
// top: 30,
// right: 10

View file

@ -553,6 +553,12 @@ var AIRTIME = (function(AIRTIME) {
return getDatatablesStrings({
"sEmptyTable": $.i18n._(""),
"sZeroRecords": $.i18n._("No matching results found.")
//"oPaginate": {
// "sFirst": "<<",
// "sLast": ">>",
// "sNext": ">",
// "sPrevious": "<"
//}
});
break;
}
@ -612,7 +618,7 @@ var AIRTIME = (function(AIRTIME) {
/* Upload Time */ { "sTitle" : $.i18n._("Uploaded") , "mDataProp" : "utime" , "bVisible" : false , "sClass" : "library_upload_time" , "sWidth" : "155px" },
/* Website */ { "sTitle" : $.i18n._("Website") , "mDataProp" : "info_url" , "bVisible" : false , "sClass" : "library_url" , "sWidth" : "150px" },
/* Year */ { "sTitle" : $.i18n._("Year") , "mDataProp" : "year" , "bVisible" : false , "sClass" : "library_year" , "sWidth" : "60px" },
/* Context Menu */ { "sTitle" : "" , "mDataProp" : "options" , "bSortable" : false , "bSearchable" : false , "sWidth" : "16px", "sClass" : "library_actions" }
/* Context Menu */ { "sTitle" : "" , "mDataProp" : "options" , "bSortable" : false , "bSearchable" : false , "sWidth" : "20px", "sClass" : "library_actions" }
],
"bProcessing": true,
@ -793,8 +799,8 @@ var AIRTIME = (function(AIRTIME) {
"bAutoWidth": false,
"oLanguage": getLibraryDatatableStrings(),
// R = ColReorder, C = ColVis
"sDom": 'Rf<"dt-process-rel"r><"H"<"library_toolbar"C>><"dataTables_scrolling"t<"#library_empty"<"#library_empty_image"><"#library_empty_text">>><"F"ilp>>',
// z = ColResize, R = ColReorder, C = ColVis
"sDom": 'Rf<"dt-process-rel"r><"H"<"library_toolbar"C>><"dataTables_scrolling"t<"#library_empty"<"#library_empty_image"><"#library_empty_text">>><"F"lip>>',
"oColVis": {
"sAlign": "right",

View file

@ -17,7 +17,7 @@ $(document).ready(function () {
Dropzone.options.addMediaDropzone = {
url: '/rest/media',
//clickable: false,
acceptedFiles: acceptedMimeTypes.join() + ",.flac",
acceptedFiles: acceptedMimeTypes.join(),
addRemoveLinks: true,
dictRemoveFile: $.i18n._("Remove"),
init: function () {
@ -232,6 +232,23 @@ $(document).ready(function () {
getUsabilityHint();
}
});
},
"fnCreatedRow": function(nRow) {
$(nRow).find("td").hover(
function () {
var sw = $(this)[0].scrollWidth, iw = $(this).innerWidth();
if (sw > iw) {
$(this).stop().animate({
textIndent: "-" + (sw + 2 - iw) + "px"
}, sw * 8);
}
},
function () {
$(this).stop().animate({
textIndent: "0"
}, 500);
}
);
}
});
@ -256,15 +273,15 @@ $(document).ready(function () {
$("#upload_status_all").click(function () {
self.uploadFilter = "all";
self.recentUploadsTable.fnDraw();
self.recentUploadsTable.fnPageChange(0).fnDraw();
});
$("#upload_status_pending").click(function () {
self.uploadFilter = "pending";
self.recentUploadsTable.fnDraw();
self.recentUploadsTable.fnPageChange(0).fnDraw();
});
$("#upload_status_failed").click(function () {
self.uploadFilter = "failed";
self.recentUploadsTable.fnDraw();
self.recentUploadsTable.fnPageChange(0).fnDraw();
});
//Create the recent uploads table.