Sha256: a8371bff29c3fd067e85cf670021e0c800491ae0b802af9b2d62597ff84a80b4

Contents?: true

Size: 943 Bytes

Versions: 6

Compression:

Stored size: 943 Bytes

Contents

window.shopappSnackbar = function(message, timeout) {
  if(timeout === undefined) {
    timeout = 5000;
  }
  $('body').append("<div class=\"snackbar snackbar-left show\"><div class=\"snackbar-body\">" +
                   message +
                   "</div></div>");
  setTimeout(function() {
    $('.snackbar').removeClass('show');
  }, timeout);
}

window.shopappAlert = function(message, type) {
  if (type === undefined) {
    type = 'danger';
  }
  $('main > div:nth-child(2) > div:first-child').append(
      '<div class="alert alert-' + type + ' alert-dismissible fade mt-3 show" role="alert">' +
      message +
      '<button aria-label="Close" class="close" data-dismiss="alert" type="button"><span aria-hidden="true">×</span></button></div>');
}

// Following makes BS tooltips work. See /views/layouts/application.html.haml
$(function() {
  $('[data-tooltip="tooltip"]').tooltip();
  $('[data-toggle="tooltip"]').tooltip();
});

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
shopapp-0.77.07 app/assets/javascripts/shopapp3.js
shopapp-0.76.06 app/assets/javascripts/shopapp3.js
shopapp-0.76.05 app/assets/javascripts/shopapp3.js
shopapp-0.76.04 app/assets/javascripts/shopapp3.js
shopapp-0.75.03 app/assets/javascripts/shopapp3.js
shopapp-0.75.02 app/assets/javascripts/shopapp3.js