mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
Fix labels for static graphs with image inserted, and avoid create without icon image - #1406
This commit is contained in:
parent
f8023bf44a
commit
99d5527c67
@ -304,6 +304,10 @@ function update_button_palette_callback() {
|
|||||||
alert('Undefined height');
|
alert('Undefined height');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if(values['image'] == ''){
|
||||||
|
alert('Undefined image');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$("#text_" + idItem).html(values['label']);
|
$("#text_" + idItem).html(values['label']);
|
||||||
|
|
||||||
@ -691,6 +695,10 @@ function create_button_palette_callback() {
|
|||||||
alert('Undefined height');
|
alert('Undefined height');
|
||||||
validate = false;
|
validate = false;
|
||||||
}
|
}
|
||||||
|
if(values['image'] == ''){
|
||||||
|
alert('Undefined image');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if ((values['label'] == '') && (values['image'] == '') && (values['show_statistics']) == false) {
|
if ((values['label'] == '') && (values['image'] == '') && (values['show_statistics']) == false) {
|
||||||
alert($("#message_alert_no_label_no_image").html());
|
alert($("#message_alert_no_label_no_image").html());
|
||||||
validate = false;
|
validate = false;
|
||||||
|
@ -208,51 +208,52 @@ $ignored_params['refr'] = '';
|
|||||||
|
|
||||||
$(".overlay").removeClass("overlay").addClass("overlaydisabled");
|
$(".overlay").removeClass("overlay").addClass("overlaydisabled");
|
||||||
|
|
||||||
$('.item:not(.icon) img').each(function(){
|
$('.item:not(.icon) img:not(.b64img)').each( function() {
|
||||||
|
if ($(this).css('float')=='left' || $(this).css('float')=='right') {
|
||||||
|
if( $(this).parent()[0].tagName == 'DIV'){
|
||||||
if($(this).css('float')=='left' || $(this).css('float')=='right'){
|
$(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-top',(parseInt($(this).parent().parent().css('height'))/2-parseInt($(this).css('height'))/2)+'px');
|
||||||
$(this).css('margin-left','');
|
}
|
||||||
|
$(this).css('margin-left','');
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
$(this).css('margin-left',(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
|
if(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2 < 0){
|
||||||
$(this).css('margin-top','');
|
$(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(){
|
$('.item > div').each( function() {
|
||||||
if($(this).css('float')=='left' || $(this).css('float')=='right'){
|
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','');
|
||||||
$(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-left',(parseInt($(this).parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
|
||||||
$(this).css('margin-top','');
|
$(this).css('margin-top','');
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.item > a > div').each(function(){
|
$('.item > a > div').each( function() {
|
||||||
if($(this).css('float')=='left' || $(this).css('float')=='right'){
|
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','');
|
||||||
$(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-left',(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
|
||||||
$(this).css('margin-top','');
|
$(this).css('margin-top','');
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".graph:not([class~='noresizevc'])").each(function(){
|
$(".graph:not([class~='noresizevc'])").each(function(){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user