Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $('#recency-link').click(function(){
  2.       $("#segment-rules .rules-wrap").append("<div id='recency-rule' class='rule-block'><div class='rule-head'><select><option>Recency</option><option>Recency</option></select></div><div class='rule-detail'><select><option>Last Day</option><option>Last week</option><option>Last 14 days</option><option>Last month</option><option value='lastNHs'>Last <em>n</em> horas</option></select></div><div class='cross'></div></div>");
  3.      
  4.       $('#segment-rules select').selectric();
  5.       $('#recency-rule .cross').click(function(){
  6.         $(this).parents('.rule-block').remove();
  7.         $('#recency-link').show();
  8.       });
  9.      
  10.       $('.rule-detail select').on('change', function() {
  11.         if ($(this).val() == 'lastNHs') {
  12.           $(this).parent().parent().addClass('lastNHs')
  13.           $("#recency-rule .rule-detail").append("<div class='recency_hs'><input></input></div>");
  14.         }
  15.         $(".recency_hs").remove();
  16.       });
  17.       return false;
  18.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement