beyond-rails 0.0.212 → 0.0.213

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 66767efb242ab578214d8635453980ed11de8f8b7a726e44bd3637c5fb258b20
4
- data.tar.gz: a87bb51ac683959f961452da0bb269903277681ea398639f7799ec03a447db8f
3
+ metadata.gz: 2f05dc67074a2bbbb2452bf6601fb84bce75d31d855f2fb0d9ca2f4ae06ad204
4
+ data.tar.gz: 6feee148ac04faab716cc6ecc21f7e76a0b63d3a1d6504dc82957a29b6760c8a
5
5
  SHA512:
6
- metadata.gz: '08ecb52a279b63b7563b609d1e85dc0239de376005e9fe0339dd4d766916e930ffea6e3c8295400f54d07672f15e7a2cd632e499c820239a2296d02cab0c7e05'
7
- data.tar.gz: 8212aa99a1ff83d5af31a9ac7ae1478d47e30b65341fa84e26aa0993a79a8388ac4d2005c87b4d9142b802b7118e66eb3935d2256329309ee725756c5f1bd7b4
6
+ metadata.gz: fce00e43c9ac3808aeb3e9b51a9b1fdf1321fabf0b10f60c8e3ac65a21e8f822f4f58a4141380e0fe8897ed963216d8eee8702aea87d861940d7e43d03eb569b
7
+ data.tar.gz: 548980fa0da747fd851ea4f659712a1382bfa8dcb7ae858ef7e1403f6a1a346346ec403ebfe4afdfbc43266c00f533dc20e5a7731d1d5374fbd99f80e56b4af6
@@ -1,5 +1,6 @@
1
1
  import supportDom from '../decorators/supportDom'
2
2
  import { noop } from '../utils'
3
+ import domEval from '../utils/domEval'
3
4
 
4
5
  let globalModalId = 0
5
6
 
@@ -56,6 +57,9 @@ export default class Modal {
56
57
  this.modal.style.display = 'block'
57
58
  setTimeout(() => {
58
59
  this.modal.classList.add('js-active')
60
+ if (typeof $ === 'function') {
61
+ $(this.dom).trigger('beyond.modal.show')
62
+ }
59
63
  }, 50)
60
64
  }
61
65
 
@@ -64,6 +68,9 @@ export default class Modal {
64
68
  this.modal.classList.remove('js-active')
65
69
  setTimeout(() => {
66
70
  this.modal.style.display = 'none'
71
+ if (typeof $ === 'function') {
72
+ $(this.dom).trigger('beyond.modal.hide')
73
+ }
67
74
  }, 300)
68
75
  }
69
76
 
@@ -87,6 +94,9 @@ export default class Modal {
87
94
  this.dom = dom
88
95
  this.dom._modal = this
89
96
  this.init()
97
+
98
+ Array.from(dom.querySelectorAll('script'))
99
+ .forEach(script => domEval(script.text))
90
100
  }
91
101
 
92
102
  visible() {
@@ -0,0 +1,5 @@
1
+ export default function domEval(code) {
2
+ const script = document.createElement('script')
3
+ script.text = code
4
+ document.head.appendChild(script).parentNode.removeChild(script)
5
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beyond-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.212
4
+ version: 0.0.213
5
5
  platform: ruby
6
6
  authors:
7
7
  - kmsheng
@@ -173,6 +173,7 @@ files:
173
173
  - src/js/utils/dateGt.js
174
174
  - src/js/utils/dateLt.js
175
175
  - src/js/utils/docReady.js
176
+ - src/js/utils/domEval.js
176
177
  - src/js/utils/getFloatedTargetPos.js
177
178
  - src/js/utils/getKey.js
178
179
  - src/js/utils/index.js