redux-framework icon indicating copy to clipboard operation
redux-framework copied to clipboard

Typography

Open eplanetdesign opened this issue 12 years ago • 5 comments

Maybe this was done on purpose but; field_typography.js as two //init when value is changed Lines 227 and 231.

In field_typography.php the font-size input field is missing the "redux-typography" class. If you add that class then in field_typography.js you can eliminate the 2nd //init when value is changed line 232

'keyup' does not work for spinners and that is why my font-size spinner was not updating the preview

*** Edit *** The "field_typography" class should be added to the div, not the input field... just like all the other textfields: class="span2 redux-typography redux-typography-size mini

eplanetdesign avatar Mar 19 '14 03:03 eplanetdesign

If the first init is eliminated, the select fields won't be updated. The second one is obviously for keyup when numbers are entered. Both are needed. Spinner uses blur, I believe.

kprovance avatar Mar 19 '14 03:03 kprovance

Just because you deleted your reply doesn't mean I didn't see it. I get them via email.

The other loss we'd suffer by doing it the way you propose is real time updating of the typography preview on keyup. If I changed it - being the expert and all - I guarantee you someone would come back and complain that 'it don't work anymore'. I will add the class name to the size field, however. Looks like whoever wrote the field missed it. It happens.

kprovance avatar Mar 19 '14 04:03 kprovance

I know you get it via email. And you are right, if you removed the second one you would have to rewrite the first one: jQuery('.redux-typography').on('keyup change', function() { typographySelect(this); });

I'm not trying to be a jerk, and sorry if it seemed that way. My main problem was the font-size was not updating the preview via spinner because the field-typography class is missing.

I shouldn't have phrased it the way I did, as after thinking about it, it sounded sarcastic, it's that I am not by any means an expert at js, whereas you guys truly are.

Thank you for adding the class.

eplanetdesign avatar Mar 19 '14 04:03 eplanetdesign

No, it's cool. And for the record, I am FAR from an expert. Having done the docs and endless bug fixes with Redux, I am intimately familiar with her code base and how she's put together. I actually had a dream about it last night...someone going into the repo and messing with the slider (the new I put together). I was piiiiiised. ;-)

kprovance avatar Mar 19 '14 05:03 kprovance

I hear ya' about the dreams! I've had many dreams about coding and it's always a problem I can't fix and everything is all weird and when I wake up... I'm totally exhausted. :)

eplanetdesign avatar Mar 19 '14 05:03 eplanetdesign