Sha256: 496373a99a49d81e543a841693d08fd10d7906420a83f1a0e99390a342d2f497

Contents?: true

Size: 931 Bytes

Versions: 3

Compression:

Stored size: 931 Bytes

Contents

jQuery(function($) {
  $('.message_list').on('click', '.message', function(e) {
    var self = $(this);
    var link = self.find('a').attr('href');
    $('iframe').attr('src', link);
    self.parent().find('.active').removeClass('active');
    self.addClass('active');
  });
  $('#toggle_selection').on('click', function(e) {
    var self = $(this);
    var messages = $('input:checkbox', '.message_list');
    if(self.prop('checked')) {
      messages.prop({'checked':'checked'});
    } else {
      messages.prop({'checked':false});
    }
  });
  $('#delete').on('submit', function(e) {
    var ids = $('.message input[type="checkbox"]:checked').map(function(){ return $(this).val(); }).toArray().join(',');
    if (ids.length <= 0) { return false; }
    var self = $(this), message = self.data('confirm');
    if (message && !confirm(message)) { return false; }
    $(this).find(':hidden[name=message_ids]').val(ids);
  });
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
letter_opener-web-0.1.2 lib/letter_opener/web/assets/javascripts/application.js
letter_opener-web-0.1.1 lib/letter_opener/web/assets/javascripts/application.js
letter_opener-web-0.1.0 lib/letter_opener/web/assets/javascripts/application.js