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

@ -56,19 +56,7 @@ $(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") {
if (AIRTIME.showLib === true) {
$lib.show()
.width(Math.floor(screenWidth * 0.5));
@ -77,8 +65,6 @@ $(document).ready(function(){
.remove()
.end();
}
}
});
AIRTIME.library.libraryInit();
AIRTIME.showbuilder.builderDataTable();