Form toggler broke with multiple classes in 1.3

edited June 2015 in Bug Reports
It seems that this no longer works/toggles when upgrading to 1.3. Switching my branch back to 1.2 and it works fine:

$fields['toggler'] = array('order' => 301, 'type' => 'toggler', 'label' => 'Media Type', 'prefix' => 'toggle_', 'options' => array('1' => 'Image', '2' => 'HTML')); $fields['image'] = array('order' => 302, 'class' => 'toggle toggle_1 asset_select images'); $fields['html'] = array('order' => 303, 'label' => 'HTML', 'class' => 'toggle toggle_2 wysiwyg', 'type' => 'textarea');

I am assuming in 1.3, it does not play well with classes such as "asset_select", "images", ect?

Comments

  • edited 4:53PM
    Does it work for you if you change the order of the classes (e.g. wysiwyg toggle toggle_2)?
  • edited June 2015
    Sadly the order had no effect.

    For debugging, I renamed the fields to:

    $fields['image_1']
    $fields['html_1']

    and toggling works, however these fields are not in the database so it's useless. very strange....
  • edited 4:53PM
    I think that may be a bug. You mind trying a change out on your end before I post to the develop branch? Try changing the following on line 1287 or so in the fuel/modules/fuel/assets/js/fuel/custom_fields.js file:
    $(context).on('change.toggler', 'select.toggler, input[type="radio"].toggler:checked', function(e){ var context = $(this).closest('.form'); toggler(this, context); })
Sign In or Register to comment.