Skip to content

Instantly share code, notes, and snippets.

@notyoyoma
Created October 24, 2017 16:30
Show Gist options
  • Save notyoyoma/659ddd7189cf68c0c8a82056a6a10901 to your computer and use it in GitHub Desktop.
Save notyoyoma/659ddd7189cf68c0c8a82056a6a10901 to your computer and use it in GitHub Desktop.
window.$ = window.jQuery = require('jquery');
import Popper from 'popper.js';
window.Popper = Popper;
window.Cookies = require('js-cookie');
require('./django_ajax_csrf.js');
require('bootstrap/dist/js/bootstrap.js');
require('core/static/css/styles.scss');
$.fn.flashMessage = function(message, callback, duration) {
$(this).css({position:'relative'});
let msg = $('<div class="flash-message">'+message+'</div>');
$(this).append(msg);
setTimeout(callback || function(){
msg.remove();
}, duration || 2000);
return $(this);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment