Sha256: 65da8e8efdefe4cae669d51a99f53cd0bdddfaf2771756e01c63c16f2401ee4c

Contents?: true

Size: 1.36 KB

Versions: 5

Compression:

Stored size: 1.36 KB

Contents

// Courtesy of https://medium.com/@chrismnicola/leaving-sprockets-for-webpack-ccf7c6993ffa
function requireAll(r) { r.keys().forEach(r); }
function requireTree(path) { requireAll(require.context('./', true, /\.(js|coffee)$/)) }

window.$        = window.jQuery = require('jquery')
window._        = require('lodash')
window.is       = require('is')
window.Mustache = require('mustache/mustache')

require('mvpkit/assets/js/application')
require('bootstrap/dist/js/bootstrap')
require('selectize/dist/js/selectize')
require('mustache')

requireTree('lib')
requireTree('behaviors')
requireTree('controllers')

document.addEventListener("turbolinks:load", function(){
  // $('*[data-toggle="popover"]').popover()
  // $('select').selectize()
  $('[data-toggle="tooltip"]').tooltip()
  $('[data-toggle="popover"]').popover()

  // Redirect to hash after page is loaded since the conversation is injected
  if (!is.empty(window.location.hash.substring(1)) ) {
    location.href = "#" + window.location.hash.substring(1);
  }

  setTimeout(function(){
    $('.fadeout.alert').fadeOut('slow')
  }, 2000);

  $(document).on('turbolinks:click', function (event) {
    if (event.target.getAttribute('href').charAt(0) === '#') {
      return event.preventDefault()
    }
  })
})

jQuery.fn.extend({
  disable: function(state) {
    return this.each(function() {
        this.disabled = state;
    });
  }
})

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mvpkit-1.0.4 project/app/webpack/javascripts/pack.js
mvpkit-1.0.3 project/app/webpack/javascripts/pack.js
mvpkit-1.0.2 project/app/webpack/javascripts/pack.js
mvpkit-1.0.1 project/app/webpack/javascripts/pack.js
mvpkit-1.0.0 project/app/webpack/javascripts/pack.js