Don't reload datatable when selecting same media type
This commit is contained in:
parent
8609934861
commit
0324c59100
|
@ -576,12 +576,12 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
var type;
|
var type;
|
||||||
aoData.push( { name: "format", value: "json"} );
|
aoData.push( { name: "format", value: "json"} );
|
||||||
aoData.push( { name: "advSearch", value: advSearchValid} );
|
aoData.push( { name: "advSearch", value: advSearchValid} );
|
||||||
|
|
||||||
// push whether to search files/playlists or all.
|
// push whether to search files/playlists or all.
|
||||||
type = $(".media_type_selector.selected").attr("selection_id");
|
type = $(".media_type_selector.selected").attr("selection_id");
|
||||||
type = (type === undefined) ? 1 : type;
|
type = (type === undefined) ? 1 : type;
|
||||||
aoData.push( { name: "type", value: type} );
|
aoData.push( { name: "type", value: type} );
|
||||||
|
|
||||||
$.ajax( {
|
$.ajax( {
|
||||||
"dataType": 'json',
|
"dataType": 'json',
|
||||||
"type": "POST",
|
"type": "POST",
|
||||||
|
@ -968,11 +968,14 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".media_type_selector").on("click", function() {
|
$(".media_type_selector").on("click", function() {
|
||||||
$(".media_type_selector").each(function() {
|
if (!$(this).hasClass("selected")) {
|
||||||
$(this).removeClass("selected");
|
// TODO: deselect any highlighted items when we switch filtering
|
||||||
});
|
$(".media_type_selector").each(function () {
|
||||||
$(this).addClass("selected");
|
$(this).removeClass("selected");
|
||||||
oTable.fnDraw();
|
});
|
||||||
|
$(this).addClass("selected");
|
||||||
|
oTable.fnDraw();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue