From 6bbbdd540489de2362a598b45f3ba397f45efb6a Mon Sep 17 00:00:00 2001 From: James Moon Date: Thu, 5 May 2011 12:14:29 -0700 Subject: [PATCH] CC-2238: Deleting a playlist from right list Fixed. 1. It only clears the left window form if 'delete' action is clickced on the opened playlist. 2. similar functionality was implemented when 'edit meatadata' form is opened in the left window. --- airtime_mvc/application/controllers/PlaylistController.php | 2 ++ airtime_mvc/public/js/airtime/library/library.js | 4 +++- airtime_mvc/public/js/airtime/library/spl.js | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) 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(); });