CC-3503 : Preserve the state of "Now Playing" screen - whether Library section is open or not

This commit is contained in:
Naomi Aro 2012-03-28 16:14:02 +02:00
parent 03c5daa9e7
commit fe21abf16d
2 changed files with 64 additions and 5 deletions

View file

@ -56,6 +56,30 @@ $(document).ready(function(){
AIRTIME.showbuilder.fnServerData.start = oRange.start;
AIRTIME.showbuilder.fnServerData.end = oRange.end;
$.ajax({
url: "/usersettings/get-now-playing-screen-settings",
type: "GET",
data: {format: "json"},
dataType: "json",
success: function(json){
var o = json.settings;
if (o === undefined) {
return;
}
if (o.library === "true") {
$lib.show()
.width(Math.floor(screenWidth * 0.5));
$builder.width(Math.floor(screenWidth * 0.5))
.find("#sb_edit")
.remove()
.end();
}
}
});
AIRTIME.library.libraryInit();
AIRTIME.showbuilder.builderDataTable();
@ -91,8 +115,8 @@ $(document).ready(function(){
oTable.fnDraw();
});
$builder.on("click","#sb_edit", function(ev){
$builder.on("click","#sb_edit", function () {
var schedTable = $("#show_builder_table").dataTable();
//reset timestamp to redraw the cursors.
@ -106,10 +130,18 @@ $(document).ready(function(){
.remove()
.end();
schedTable.fnDraw();
schedTable.fnDraw();
$.ajax({
url: "/usersettings/set-now-playing-screen-settings",
type: "POST",
data: {settings : {library : true}, format: "json"},
dataType: "json",
success: function(){}
});
});
$lib.on("click", "#sb_lib_close", function(ev) {
$lib.on("click", "#sb_lib_close", function() {
var schedTable = $("#show_builder_table").dataTable();
$lib.hide();
@ -119,6 +151,14 @@ $(document).ready(function(){
.end();
schedTable.fnDraw();
$.ajax({
url: "/usersettings/set-now-playing-screen-settings",
type: "POST",
data: {settings : {library : false}, format: "json"},
dataType: "json",
success: function(){}
});
});
$builder.find('legend').click(function(ev, item){