Merge branch '1626-Fallo-al-clonar-item-de-la-consola-visual-dev' into 'develop'

Fixed copy item in visual console

See merge request artica/pandorafms!1106
This commit is contained in:
vgilc 2017-12-21 08:56:17 +01:00
commit c98e94e59e

View File

@ -375,7 +375,7 @@ function update_button_palette_callback() {
} }
if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
$("#image_" + idItem).removeAttr('width'); $("#image_" + idItem).removeAttr('width');
$("#image_" + idItem).removeAttr('height'); $("#image_" + idItem).removeAttr('height');
$("#image_" + idItem).attr('width', 70); $("#image_" + idItem).attr('width', 70);
@ -503,7 +503,7 @@ function update_button_palette_callback() {
} }
if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
$("#image_" + idItem).removeAttr('width'); $("#image_" + idItem).removeAttr('width');
$("#image_" + idItem).removeAttr('height'); $("#image_" + idItem).removeAttr('height');
$("#image_" + idItem).attr('width', 70); $("#image_" + idItem).attr('width', 70);
@ -679,7 +679,7 @@ function update_button_palette_callback() {
} }
$("#image_" + idItem).attr('src', "images/spinner.gif"); $("#image_" + idItem).attr('src', "images/spinner.gif");
if ((values['width'] == 0) || (values['height'] == 0)) { if ((values['width'] == 0) || (values['height'] == 0)) {
if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
$("#image_" + idItem).removeAttr('width'); $("#image_" + idItem).removeAttr('width');
$("#image_" + idItem).removeAttr('height'); $("#image_" + idItem).removeAttr('height');
$("#image_" + idItem).attr('width', 70); $("#image_" + idItem).attr('width', 70);
@ -2807,7 +2807,7 @@ function createItem(type, values, id_data) {
// Do none // Do none
if(values['image'] != '' && values['image'] != 'none'){ if(values['image'] != '' && values['image'] != 'none'){
if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
$image.attr('width', '70') $image.attr('width', '70')
.attr('height', '70'); .attr('height', '70');
} }
@ -2932,7 +2932,7 @@ function createItem(type, values, id_data) {
if(values['image'] != '' && values['image'] != 'none'){ if(values['image'] != '' && values['image'] != 'none'){
// Do none // Do none
if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
$image.attr('width', '70') $image.attr('width', '70')
.attr('height', '70'); .attr('height', '70');
} }
@ -3030,18 +3030,15 @@ function createItem(type, values, id_data) {
if ((values['width'] == 0) || (values['height'] == 0)) { if ((values['width'] == 0) || (values['height'] == 0)) {
// Do none // Do none
if(values['image'] != '' && values['image'] != 'none'){ if(values['image'] != '' && values['image'] != 'none'){
if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ $image.attr('width', '70')
$image.attr('width', '70') .attr('height', '70');
.attr('height', '70'); }
} else{
else{ $image.attr('width', $('#preview > img')[0].naturalWidth)
$image.attr('width', $('#preview > img')[0].naturalWidth) .attr('height', $('#preview > img')[0].naturalHeight);
.attr('height', $('#preview > img')[0].naturalHeight); }
} }
}
else{ else{
$image.attr('width', '70') $image.attr('width', '70')
.attr('height', '70'); .attr('height', '70');
@ -3166,7 +3163,7 @@ function createItem(type, values, id_data) {
if(values['image'] != '' && values['image'] != 'none'){ if(values['image'] != '' && values['image'] != 'none'){
// Do none // Do none
if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
$image.attr('width', '70') $image.attr('width', '70')
.attr('height', '70'); .attr('height', '70');
} }
@ -3447,7 +3444,7 @@ function createItem(type, values, id_data) {
break; break;
case 'icon': case 'icon':
if ((values['width'] == 0) || (values['height'] == 0)) { if ((values['width'] == 0) || (values['height'] == 0)) {
if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
sizeStyle = 'width: ' + '70' + 'px; height: ' + '70' + 'px;'; sizeStyle = 'width: ' + '70' + 'px; height: ' + '70' + 'px;';
imageSize = 'width="' + '70' + '" height="' + '70' + '"'; imageSize = 'width="' + '70' + '" height="' + '70' + '"';
} }