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

@ -1970,20 +1970,29 @@ ul.errors li, .warning {
div.success{
color:#3B5323;
font-size:11px;
padding:2px 4px;
font-size:14px;
padding:2px 10px;
background:#93DB70;
margin-bottom:2px;
margin-bottom:0px;
border:1px solid #488214;
display: inline-block;
text-align: right;
float: right;
height: 30px;
line-height: 24px;
box-sizing: border-box;;
}
div.errors, span.errors{
color:#902d2d;
font-size:11px;
padding:2px 4px;
font-size:14px;
padding:2px 10px;
background:#c6b4b4;
margin-bottom:2px;
margin-bottom:0px;
border:1px solid #c83f3f;
height: 30px;
line-height: 24px;
box-sizing: border-box;;
}
span.errors.sp-errors{

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();

View file

@ -522,6 +522,9 @@ function callback(json, type) {
//redraw library table so the length gets updated
dt.fnStandingRedraw();
}
else {
AIRTIME.playlist.playlistResponse(json);
}
form.find('.smart-block-form').removeClass("closed");
}
setTimeout(removeSuccessMsg, 5000);