Sha256: 7b2156a3c0737a08a8c55bbe5880308a10ca10de901c1018a8e94970d36c3a53

Contents?: true

Size: 780 Bytes

Versions: 3

Compression:

Stored size: 780 Bytes

Contents

var Modal = (function () {

  function open (modalId, event) {
    $('#' + modalId + '.elements-modal').addClass('elements-modal--active')
    setTimeout(function () {
      $('#' + modalId + '.elements-modal').find('.elements-modal__modal').addClass('elements-modal__modal--active')
    }, 500)
    $('body').addClass('stop-scrolling')
    if (event) {
      event.preventDefault()
    }
  }

  function close (modalId, event) {
    $('#' + modalId + '.elements-modal').removeClass('elements-modal--active')
    $('#' + modalId + '.elements-modal').find('.elements-modal__modal').removeClass('elements-modal__modal--active')
    $('body').removeClass('stop-scrolling')
    if (event) {
      event.preventDefault()
    }
  }

  return {
    open: open,
    close: close
  }

})()

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lato_core-2.1.2 app/assets/javascripts/lato_core/interfaces/Modal.js
lato_core-2.1.1 app/assets/javascripts/lato_core/interfaces/Modal.js
lato_core-2.1 app/assets/javascripts/lato_core/interfaces/Modal.js