CC-3885: Deleted open playlist is not closed until a new item is added to it
-fixed
This commit is contained in:
parent
76cb04e296
commit
04ed640756
|
@ -14,6 +14,7 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
->addActionContext('new', 'json')
|
->addActionContext('new', 'json')
|
||||||
->addActionContext('edit', 'json')
|
->addActionContext('edit', 'json')
|
||||||
->addActionContext('delete', 'json')
|
->addActionContext('delete', 'json')
|
||||||
|
->addActionContext('close-playlist', 'json')
|
||||||
->addActionContext('play', 'json')
|
->addActionContext('play', 'json')
|
||||||
->addActionContext('set-playlist-fades', 'json')
|
->addActionContext('set-playlist-fades', 'json')
|
||||||
->addActionContext('get-playlist-fades', 'json')
|
->addActionContext('get-playlist-fades', 'json')
|
||||||
|
@ -246,6 +247,13 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function closePlaylistAction() {
|
||||||
|
$type = $this->_getParam('type');
|
||||||
|
$obj = null;
|
||||||
|
Application_Model_Library::changePlaylist($obj, $type);
|
||||||
|
$this->createFullResponse($obj);
|
||||||
|
}
|
||||||
|
|
||||||
public function addItemsAction()
|
public function addItemsAction()
|
||||||
{
|
{
|
||||||
$ids = $this->_getParam('aItems', array());
|
$ids = $this->_getParam('aItems', array());
|
||||||
|
|
|
@ -322,22 +322,40 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
};
|
};
|
||||||
|
|
||||||
mod.fnDeleteSelectedItems = function() {
|
mod.fnDeleteSelectedItems = function() {
|
||||||
if (confirm($.i18n._('Are you sure you want to delete the selected item(s)?'))) {
|
if (confirm($.i18n._('Are you sure you want to delete the selected item(s)?'))) {
|
||||||
var aData = AIRTIME.library.getSelectedData(),
|
var aData = AIRTIME.library.getSelectedData(),
|
||||||
item,
|
item,
|
||||||
temp,
|
temp,
|
||||||
aMedia = [];
|
aMedia = [],
|
||||||
|
currentObjId = $("#side_playlist").find("#obj_id").val(),
|
||||||
// process selected files/playlists.
|
currentObjType = $("#side_playlist").find("#obj_type").val(),
|
||||||
for (item in aData) {
|
closeObj = false;
|
||||||
temp = aData[item];
|
|
||||||
if (temp !== null && temp.hasOwnProperty('id') ) {
|
// process selected files/playlists.
|
||||||
aMedia.push({"id": temp.id, "type": temp.ftype});
|
for (item in aData) {
|
||||||
}
|
temp = aData[item];
|
||||||
}
|
if (temp !== null && temp.hasOwnProperty('id') ) {
|
||||||
|
aMedia.push({"id": temp.id, "type": temp.ftype});
|
||||||
AIRTIME.library.fnDeleteItems(aMedia);
|
if ( (temp.id == currentObjId && temp.ftype === currentObjType) ||
|
||||||
}
|
temp.id == currentObjId && temp.ftype === "stream" && currentObjType === "webstream") {
|
||||||
|
closeObj = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
AIRTIME.library.fnDeleteItems(aMedia);
|
||||||
|
|
||||||
|
// close the object (playlist/block/webstream)
|
||||||
|
// on the right side if it was just deleted
|
||||||
|
// from the library
|
||||||
|
if (closeObj) {
|
||||||
|
$.post(baseUrl+"playlist/close-playlist",
|
||||||
|
{"format": "json", "type": currentObjType},
|
||||||
|
function(json) {
|
||||||
|
$("#side_playlist").empty().append(json.html);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
libraryInit = function() {
|
libraryInit = function() {
|
||||||
|
|
Loading…
Reference in New Issue