Merge branch '1406-Visual-consoles-e-imagenes-HTML-4623-com1' into 'develop'

Fix labels for static graphs with image inserted, and avoid create without icon image - #1406

See merge request artica/pandorafms!903
This commit is contained in:
nramon 2017-10-30 15:26:58 +01:00
commit cac7a181ea
2 changed files with 41 additions and 32 deletions

View File

@ -298,7 +298,11 @@ function update_button_palette_callback() {
alert('Undefined height');
return false;
}
if(values['image'] == ''){
alert('Undefined image');
return false;
}
$("#text_" + idItem).html(values['label']);
if(values['show_statistics'] == 1){
@ -697,6 +701,10 @@ function create_button_palette_callback() {
alert('Undefined height');
validate = false;
}
if(values['image'] == ''){
alert('Undefined image');
return false;
}
if ((values['label'] == '') && (values['image'] == '') && (values['show_statistics']) == false) {
alert($("#message_alert_no_label_no_image").html());
validate = false;

View File

@ -208,51 +208,52 @@ $ignored_params['refr'] = '';
$(".overlay").removeClass("overlay").addClass("overlaydisabled");
$('.item:not(.icon) img').each(function(){
if($(this).css('float')=='left' || $(this).css('float')=='right'){
$(this).css('margin-top',(parseInt($(this).parent().parent().css('height'))/2-parseInt($(this).css('height'))/2)+'px');
$(this).css('margin-left','');
$('.item:not(.icon) img:not(.b64img)').each( function() {
if ($(this).css('float')=='left' || $(this).css('float')=='right') {
if( $(this).parent()[0].tagName == 'DIV'){
$(this).css('margin-top',(parseInt($(this).parent().css('height'))/2-parseInt($(this).css('height'))/2)+'px');
}
else if ( $(this).parent()[0].tagName == 'A') {
$(this).css('margin-top',(parseInt($(this).parent().parent().css('height'))/2-parseInt($(this).css('height'))/2)+'px');
}
$(this).css('margin-left','');
}
else{
$(this).css('margin-left',(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
$(this).css('margin-top','');
else {
if(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2 < 0){
$(this).css('margin-left','');
$(this).css('margin-top','');
} else {
if( $(this).parent()[0].tagName == 'DIV'){
$(this).css('margin-left',(parseInt($(this).parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
}
else if ( $(this).parent()[0].tagName == 'A') {
$(this).css('margin-left',(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
}
$(this).css('margin-top','');
}
}
});
$('.item > div').each(function(){
if($(this).css('float')=='left' || $(this).css('float')=='right'){
$(this).css('margin-top',(parseInt($(this).parent().css('height'))/2-parseInt($(this).css('height'))/2-15)+'px');
$(this).css('margin-left','');
$('.item > div').each( function() {
if ($(this).css('float')=='left' || $(this).css('float')=='right') {
$(this).css('margin-top',(parseInt($(this).parent().css('height'))/2-parseInt($(this).css('height'))/2-15)+'px');
$(this).css('margin-left','');
}
else{
else {
$(this).css('margin-left',(parseInt($(this).parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
$(this).css('margin-top','');
}
});
$('.item > a > div').each(function(){
if($(this).css('float')=='left' || $(this).css('float')=='right'){
$(this).css('margin-top',(parseInt($(this).parent().parent().css('height'))/2-parseInt($(this).css('height'))/2-5)+'px');
$(this).css('margin-left','');
$('.item > a > div').each( function() {
if ($(this).css('float')=='left' || $(this).css('float')=='right') {
$(this).css('margin-top',(parseInt($(this).parent().parent().css('height'))/2-parseInt($(this).css('height'))/2-5)+'px');
$(this).css('margin-left','');
}
else{
else {
$(this).css('margin-left',(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
$(this).css('margin-top','');
}
});
$(".graph:not([class~='noresizevc'])").each(function(){