import {Tooltip} from 'bootstrap.native'

document.querySelectorAll('.copy-text').forEach(function (el) {
  el.addEventListener('click', function () {
    let el = this
    el.select()
    document.execCommand('copy')
    if (el.Tooltip) {
      let originalTitle = el.title
      el.Tooltip.hide()
      el.title = this.dataset.copied
      let t = new Tooltip(el)
      t.show()
      window.setTimeout(function () {
        t.hide()
        el.title = originalTitle
      }, 3000)
    }
  })
})

@@ -1,46 +1,4 @@
-import %7BTooltip%7D from 'bootstrap.native'%0A%0A
 docu
@@ -128,207 +128,855 @@
     
-el.select()%0A    document.execCommand('copy')%0A    if (el.Tooltip) %7B%0A      let originalTitle = el.title%0A      el.Tooltip.hide()%0A      el.title = this.dataset.copied%0A      let t = new 
+var selection%0A%0A    var isiOSDevice = navigator.userAgent.match(/ipad%7Ciphone/i)%0A%0A    if (isiOSDevice) %7B%0A      var editable = el.contentEditable%0A      var readOnly = el.readOnly%0A%0A      el.contentEditable = true%0A      el.readOnly = false%0A%0A      var range = document.createRange()%0A      range.selectNodeContents(el)%0A%0A      selection = window.getSelection()%0A      selection.removeAllRanges()%0A      selection.addRange(range)%0A%0A      el.setSelectionRange(0, 999999)%0A      el.contentEditable = editable%0A      el.readOnly = readOnly%0A    %7D else %7B%0A      el.select()%0A    %7D%0A%0A    document.execCommand('copy')%0A%0A    if (isiOSDevice) %7B%0A      selection.removeAllRanges()%0A    %7D%0A%0A    if (el.Tooltip) %7B%0A      let originalTitle = el.title%0A      el.title = el.dataset.copied%0A      el.Tooltip.hide()%0A      var switchTooltip = function () %7B%0A        el.
 Tooltip
-(el
+.show(
 )%0A      
 t.sh
@@ -975,17 +975,72 @@
     
-t.show()%0A
+  el.removeEventListener('hidden.bs.tooltip', switchTooltip)%0A%0A  
     
@@ -1085,17 +1085,28 @@
     
-t
+  el.Tooltip
 .hide()%0A
     
@@ -1097,24 +1097,26 @@
 ltip.hide()%0A
+  
         el.t
@@ -1142,16 +1142,18 @@
 e%0A      
+  
 %7D, 3000)
@@ -1153,16 +1153,87 @@
 , 3000)%0A
+      %7D%0A%0A      el.addEventListener('hidden.bs.tooltip', switchTooltip)%0A
     %7D%0A  

Improve copy input script