Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. jQuery(function() {
  2. var properties;
  3. properties = $('#segment_conditions_attributes_0_property').html();
  4. return $('#segment_conditions_attributes_0_condition_type').change(function() {
  5. var condition, condition_properties;
  6. condition = $('#segment_conditions_attributes_0_condition_type :selected').parent().attr('label');
  7. condition_properties = $(properties).filter("optgroup[label='" + condition + "']").html();
  8.  
  9. if (condition_properties) {
  10. return $('#segment_conditions_attributes_0_property').html(condition_properties);
  11. } else {
  12. return $('#segment_conditions_attributes_0_condition_type').empty();
  13. }
  14. });
  15. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement