Sha256: 5493d3274b7410296871a38bf5f4e27414a00e50e5463692a9b10c71f68b832a

Contents?: true

Size: 1.06 KB

Versions: 4

Compression:

Stored size: 1.06 KB

Contents

$(function() {
  var action_alert = $('.action-alert');
  var action_alert_count = action_alert.length;

  setTimeout(function() {
    if (action_alert_count !== 0) {
      var temp_height = 0;
      for (var i = 1; i <= action_alert_count; i ++) {
        var alert = $('.action-alert:nth-of-type(' + i + ')');
        alert.animate({bottom: i + temp_height + 'rem'});
        temp_height += parseFloat(alert.css('height')) / 10;
      }

      // $("#action_alert_audio")[0].play();
    }
  }, 200);

  var action_alert_close = action_alert.find('.close');
  action_alert_close.click(function(e) {
    var alert = $(this).parent('.action-alert');
    var select_bottom = parseFloat(alert.css('bottom')) / 10;
    var select_height = parseFloat(alert.css('height')) / 10;
    $(this).parent('.action-alert').animate({bottom: -1 * select_height - 5 + 'rem'});

    $.each(action_alert, function() {
      var bottom = parseFloat($(this).css('bottom')) / 10;
      if (bottom > select_bottom ) {
        $(this).animate({bottom: bottom - select_height - 1 + 'rem'});
      }
    })
  })
});

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tmatt_cms-0.1.7 lib/generators/tmatt_cms/templates/js/utils/action_alert.js
tmatt_cms-0.1.6 lib/generators/tmatt_cms/templates/js/utils/action_alert.js
tmatt_cms-0.1.5 lib/generators/tmatt_cms/templates/js/utils/action_alert.js
tmatt_cms-0.1.4 lib/generators/tmatt_cms/templates/js/utils/action_alert.js