Sha256: 793fd8f50c64fbe10f2738866edd2d2c74b34e80df196a41b162a7a639066580

Contents?: true

Size: 1.35 KB

Versions: 86

Compression:

Stored size: 1.35 KB

Contents

import '../../../../fonts/fontawesome-min.js'
import '../../../../fonts/regular-min.js'
import './main.scss'
import '../vendor.js'

// Move to separate file
window.$(document).on('click', '[data-toggle]', function(e) {
  e.preventDefault()

  var kitContainer = window.$(this).closest('.pb--doc')
  var toggleTarget = window.$(this).data('toggle')

  window
    .$(kitContainer)
    .find('[data-action="toggle"]')
    .hide()
  window
    .$(kitContainer)
    .find('[data-togglable="' + toggleTarget + '"]')
    .show()
})

window.$(document).ready(() => {
  $('.compress').hide()

  window.$(document).on('click', '.toggle-button', (e) => {
    e.preventDefault()
    $('.pb--codeCopy').toggleClass('close')
  })

  $('.expand').click(() => {
    $('.sample-nav').hide()
    $('.compress').show()
  })

  $('.compress').click(() => {
    $('.sample-nav').show()
    $('.compress').hide()
  })

  const setClipboard = (value) => {
    var tempInput = document.createElement('textarea')
    tempInput.style = 'position: absolute; left: -1000px; top: -1000px'
    tempInput.value = value
    document.body.appendChild(tempInput)
    tempInput.select()
    document.execCommand('copy')
    document.body.removeChild(tempInput)
  }

  $('.copy-clipboard').click(() => {
    var copyText = document.querySelector('.hiddenCodeforCopy').textContent
    setClipboard(copyText)
  })
})

Version data entries

86 entries across 86 versions & 1 rubygems

Version Path
playbook_ui-7.3.0.pre.alpha2 app/pb_kits/playbook/packs/application.js
playbook_ui-6.8.2.pre.alpha1 app/pb_kits/playbook/packs/application.js
playbook_ui-7.0.1.pre.alpha14 app/pb_kits/playbook/packs/application.js
playbook_ui-6.8.1 app/pb_kits/playbook/packs/application.js
playbook_ui-6.8.0 app/pb_kits/playbook/packs/application.js
playbook_ui-6.7.0.pre.alpha1 app/pb_kits/playbook/packs/application.js
playbook_ui-6.7.0 app/pb_kits/playbook/packs/application.js
playbook_ui-6.6.1 app/pb_kits/playbook/packs/application.js
playbook_ui-6.6.0 app/pb_kits/playbook/packs/application.js
playbook_ui-6.5.2 app/pb_kits/playbook/packs/application.js
playbook_ui-7.0.1.pre.alpha12 app/pb_kits/playbook/packs/application.js
playbook_ui-7.0.1.pre.alpha11 app/pb_kits/playbook/packs/application.js
playbook_ui-7.0.1.pre.alpha10 app/pb_kits/playbook/packs/application.js
playbook_ui-7.0.1.pre.alpha9 app/pb_kits/playbook/packs/application.js
playbook_ui-6.5.1 app/pb_kits/playbook/packs/application.js
playbook_ui-6.5.0 app/pb_kits/playbook/packs/application.js
playbook_ui-7.0.1.pre.alpha8 app/pb_kits/playbook/packs/application.js
playbook_ui-7.0.1.pre.alpha7 app/pb_kits/playbook/packs/application.js
playbook_ui-7.0.1.pre.alpha6 app/pb_kits/playbook/packs/application.js
playbook_ui-7.0.1.pre.alpha5 app/pb_kits/playbook/packs/application.js