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 17:29:34 +02:00
parent fe21abf16d
commit aca6e995dd
2 changed files with 18 additions and 23 deletions

View File

@ -92,6 +92,15 @@ class ShowbuilderController extends Zend_Controller_Action
}
}
$data = Application_Model_Preference::GetValue("nowplaying_screen", true);
if ($data != "") {
$settings = unserialize($data);
if ($settings["library"] == "true") {
$this->view->headScript()->appendScript("AIRTIME.showLib = true;");
}
}
$this->_helper->actionStack('library', 'library');
$this->_helper->actionStack('builder', 'showbuilder');
}

View File

@ -55,30 +55,16 @@ $(document).ready(function(){
oRange = AIRTIME.utilities.fnGetScheduleRange(dateStartId, timeStartId, dateEndId, timeEndId);
AIRTIME.showbuilder.fnServerData.start = oRange.start;
AIRTIME.showbuilder.fnServerData.end = oRange.end;
if (AIRTIME.showLib === true) {
$lib.show()
.width(Math.floor(screenWidth * 0.5));
$.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();
}
}
});
$builder.width(Math.floor(screenWidth * 0.5))
.find("#sb_edit")
.remove()
.end();
}
AIRTIME.library.libraryInit();
AIRTIME.showbuilder.builderDataTable();