Sha256: 473bd494799685c7a4b542783de4c7c673712bf8dd1c294fa937dd0d5ada2510

Contents?: true

Size: 358 Bytes

Versions: 4

Compression:

Stored size: 358 Bytes

Contents

const DEFAULT_TARGET = '.content'

up.macro('[modal-link]', function($link) {
  let target = $link.attr('modal-link') || DEFAULT_TARGET
  let attrs = {
    'up-modal': target,
    'up-preload': '',
    'up-instant': '',
  }

  // It feels wrong for a button
  if ($link.is('.btn:not(.btn-link)')) {
    delete attrs['up-instant']
  }

  $link.attr(attrs)
})

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
katapult-0.5.0 lib/generators/katapult/basics/templates/app/webpack/assets/javascripts/macros/modal_link.js
katapult-0.4.1 lib/generators/katapult/basics/templates/app/webpack/assets/javascripts/macros/modal_link.js
katapult-0.4.0 lib/generators/katapult/basics/templates/app/webpack/assets/javascripts/macros/modal_link.js
katapult-0.3.0 lib/generators/katapult/basics/templates/app/webpack/assets/javascripts/macros/modal_link.js