Answered

JQuery Problem Scaling and colors

I've got next product definition in FPD for jQuery:

 

<div class="fpd-product" title="Camiseta Roja" data-thumbnail="/images/product/3/front/preview.png">
	<img src="/images/product/3/front/limits.png" title="Limits" data-parameters='{"autoCenter":true,"scaleX":"0.5","scaleY":"0.5"}' />
	<img src="/images/product/3/front/base.png" title="Base" data-parameters='{"autoCenter":true,"price":20,"colors":"#ff0000,#00ff00,#0000ff","colorLinkGroup":"Base","scaleX":"0.5","scaleY":"0.5"}' />
	<img src="/images/product/3/front/shadows.png" title="Shadow" data-parameters='{"autoCenter":true,"scaleX":"0.5","scaleY":"0.5"}' />
	<img src="/images/product/3/front/body.png" title="Hightlights" data-parameters='{"autoCenter":true,"scaleX":"0.5","scaleY":"0.5"}' />
	<div class="fpd-product" title="Trasera" data-thumbnail="/images/product/3/back/preview.png">
		<img src="/images/product/3/front/limits.png" title="Limits" data-parameters='{"autoCenter":true,"scaleX":"0.5","scaleY":"0.5"}' />
		<img src="/images/product/3/back/base.png" title="Base" data-parameters='{"autoCenter":true,"colors":"#ff0000,#00ff00,#0000ff","colorLinkGroup":"Base","scaleX":"0.5","scaleY":"0.5"}' />
		<img src="/images/product/3/back/shadows.png" title="Shadow" data-parameters='{"autoCenter":true,"scaleX":"0.5","scaleY":"0.5"}' />
		<img src="/images/product/3/back/body.png" title="Hightlights" data-parameters='{"autoCenter":true,"scaleX":"0.5","scaleY":"0.5"}' />
	</div>
</div>

The problem is with scale. Product image is bigger than screen area (for printing reasons), so it's necesary to be scaled, but when scaling, colour picker is not shown, so color of "base" cannot be changed.


If scale is removed color picker appears fine.


Thank you very much for your help


  • I've being doing some test an i've found that it seems to be a javascript error.


    On click, i got the next JS error:


     

    Error: TypeError: b[f].toFixed is not a function
    Archivo de origen: http://crewded.local/js/fpd/js/FancyProductDesigner-all.min.js?20160720122125
    Línea: 10

     

    By checking source code, without minification the error is at line 5381 of FAncyProductDesigner-all.js:


     

    var numVal = $uiElement.attr('step') && $uiElement.attr('step').length > 1 ? parseFloat(element[parameter].toFixed(2)) : parseInt(element[parameter]);

     I've been looking for toFixed function declaration without success. Any idea?


    Thank you very much

  • Finally checking Javascript code i've found an error. At FancyProductDesigner-all.js, at line 5381, says:


     

    var numVal = $uiElement.attr('step') && $uiElement.attr('step').length > 1 ? parseFloat(element[parameter].toFixed(2)) : parseInt(element[parameter]);

     But there is a closing parenthesis in bad position. It must be:

    var numVal = $uiElement.attr('step') && $uiElement.attr('step').length > 1 ? parseFloat(element[parameter]).toFixed(2) : parseInt(element[parameter]);

     Same way, in minifiedd version of the file at line 10, says

     

    parseFloat(b[f].toFixed(2))

     And it must be:

     

    parseFloat(b[f]).toFixed(2)

    Please, keep this in mind for a new version solving this issue.

     

    Regards

  • Thank you, will be part of next update!

Login or Signup to post a comment