More smart block and playlist editor improvements

* Fixed smart block/playlist form validation error messages not showing up.
* Improved styling of all save/error messages across the application.
* Removed broken fade editors
This commit is contained in:
Albert Santoni 2015-08-28 14:27:18 -04:00
parent f36ff944c2
commit e743c3589e
6 changed files with 38 additions and 15 deletions

View file

@ -1028,7 +1028,7 @@ var AIRTIME = (function(AIRTIME){
if (obj_type == "block") {
callback(json, "save");
} else {
$pl.find('.success').text($.i18n._('Playlist saved'));
$pl.find('.success').text($.i18n._('Playlist saved.'));
$pl.find('.success').show();
setTimeout(removeSuccessMsg, 5000);
dt.fnStandingRedraw();
@ -1266,17 +1266,28 @@ var AIRTIME = (function(AIRTIME){
};
mod.playlistResponse = function(json){
if (json.error !== undefined) {
playlistError(json);
console.log(json);
if (json.error !== undefined || json.result != 0) {
if (json.error) {
playlistError(json);
}
AIRTIME.playlist.replaceForm(json);
}
else {
setPlaylistContent(json);
setFadeIcon();
$pl.find('.errors').hide();
}
mod.enableUI();
}
mod.replaceForm = function(json){
$pl.find('.editor_pane_wrapper').html(json.html);
openPlaylist(json);
}
function playlistRequest(sUrl, oData) {
var lastMod,
obj_type = $pl.find('.obj_type').val();