CC-3997: Now Playing -> Time Line: different behaviour between 'delete'

button and 'delete' menu items

- added confirm box on clicking delete button on now playing table
- also added confirm box on library delete button as well
This commit is contained in:
James 2012-06-26 17:43:15 -04:00
parent 4af43c7a10
commit 31d643cee1
2 changed files with 24 additions and 19 deletions

View File

@ -252,20 +252,22 @@ var AIRTIME = (function(AIRTIME) {
};
mod.fnDeleteSelectedItems = function() {
var aData = AIRTIME.library.getSelectedData(),
item,
temp,
aMedia = [];
//process selected files/playlists.
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 (confirm('Are you sure you want to delete the selected item(s)?')) {
var aData = AIRTIME.library.getSelectedData(),
item,
temp,
aMedia = [];
//process selected files/playlists.
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);
}
};
libraryInit = function() {

View File

@ -243,11 +243,14 @@ var AIRTIME = (function(AIRTIME){
mod.fnRemove = function(aItems) {
mod.disableUI();
$.post( "/showbuilder/schedule-remove",
{"items": aItems, "format": "json"},
mod.fnItemCallback
);
if (confirm("Delete selected item(s)?")) {
$.post( "/showbuilder/schedule-remove",
{"items": aItems, "format": "json"},
mod.fnItemCallback
);
}else{
mod.enableUI();
}
};
mod.fnRemoveSelectedItems = function() {