diff --git a/airtime_mvc/application/controllers/PlaylistController.php b/airtime_mvc/application/controllers/PlaylistController.php index 3df97520d..89871f14f 100644 --- a/airtime_mvc/application/controllers/PlaylistController.php +++ b/airtime_mvc/application/controllers/PlaylistController.php @@ -136,6 +136,7 @@ class PlaylistController extends Zend_Controller_Action unset($this->view->pl); } + $this->view->pl_id = $pl_id; $this->view->fieldset = $form; $this->view->form = $this->view->render('playlist/new.phtml'); } @@ -151,6 +152,7 @@ class PlaylistController extends Zend_Controller_Action $pl = $this->getPlaylist(); $this->view->pl = $pl; + $this->view->pl_id = $pl->getId(); $this->view->html = $this->view->render('playlist/index.phtml'); unset($this->view->pl); } diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index 044ef0ab8..a748f7eb6 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -64,7 +64,9 @@ function deletePlaylist(json) { deleteItem("pl", json.id); // display noOpenPL on the left window - noOpenPL(json); + if( currentlyOpenedSplId == json.id){ + noOpenPL(json); + } } //end callbacks called by jjmenu diff --git a/airtime_mvc/public/js/airtime/library/spl.js b/airtime_mvc/public/js/airtime/library/spl.js index fc65acf96..44bde2327 100644 --- a/airtime_mvc/public/js/airtime/library/spl.js +++ b/airtime_mvc/public/js/airtime/library/spl.js @@ -373,6 +373,8 @@ function createPlaylistMetaForm(json) { $("#side_playlist") .empty() .append(form); + + currentlyOpenedSplId = json.pl_id; } function newSPL() { @@ -401,6 +403,8 @@ function openDiffSPL(json) { $("#side_playlist") .empty() .append(json.html); + + currentlyOpenedSplId = json.pl_id; setUpSPL(); } @@ -512,5 +516,6 @@ function setUpSPL() { } $(document).ready(function() { + var currentlyOpenedSplId; setUpSPL(); });