[ Index ]

MailPress 7.2

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-admin/js/ -> settings_newsletter.js (source)

   1  // settings_newsletter
   2  
   3  
   4  var mp_settings_newsletter = {
   5  
   6  
   7  
   8      newsletters : jQuery('.newsletter'),
   9  
  10      select : function() {
  11  
  12          var html = '';
  13          var select = jQuery("#comment_newsletter_subscription_default");
  14          var valeur = select.val();
  15  
  16          for (var i in mp_settings_newsletter.newsletters)
  17  
  18          {
  19  
  20              var _this = mp_settings_newsletter.newsletters[i];
  21              if (_this.checked)
  22              {
  23                  curr = _this.getAttribute('newsletter');
  24                  desc = _this.getAttribute('newsletter_description');
  25                  attr = ( valeur == curr ) ? ' selected="selected"' : '';
  26  
  27  
  28  
  29                  html+= '<option value="' + curr + '"' + attr + '>' + desc + '</option>';
  30  
  31              }
  32          }
  33  
  34          var original_color = select.css('border-left-color');
  35          select.html(html);
  36      },
  37  
  38      init : function() {
  39          mp_settings_newsletter.newsletters.change(function(){
  40              if (!this.checked) jQuery('#default_'+this.id).removeAttr('checked');
  41              jQuery('#span_default_'+this.id).toggle();
  42  
  43              mp_settings_newsletter.select();
  44  
  45          });
  46  
  47      }
  48  
  49  };
  50  
  51  
  52  
  53  
  54  jQuery(document).ready( function() { mp_settings_newsletter.init(); });


Generated: Tue May 19 15:55:14 2020 Cross-referenced by PHPXref 0.7.1