beyond-rails 0.0.276 → 0.0.281
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/src/js/components/Btn.js +15 -3
- data/src/js/components/SearchDropdown.js +2 -1
- data/src/sass/components/_alert.scss +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fdbef0c60df577d5177297214104a62d44879abf628e92ba2ac9b263e344d22
|
4
|
+
data.tar.gz: 91e93ce0cc411b0721d5172b1813d347ce40268ae0815c404a34cf9c50960026
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aadf392da4fb29588d3871759b48aecaacd6e5250c9e6fcff7ec08f6d19232cb5260461565741a53c55a2397f8c6ae07a0ed7384325c9ddf2dc4066c3e19faea
|
7
|
+
data.tar.gz: e93b2ed5099895a980dcb14466a70a7e985b10cf020b83658130420050845c6c8e99043fc185f030ea060b34fcee4e61ca734b0479e67f47b0da1778d3e329f1
|
data/src/js/components/Btn.js
CHANGED
@@ -11,8 +11,11 @@ export default class Btn {
|
|
11
11
|
}
|
12
12
|
|
13
13
|
showLoader() {
|
14
|
+
if (this.loading) {
|
15
|
+
return
|
16
|
+
}
|
14
17
|
const { dom } = this
|
15
|
-
this.
|
18
|
+
this.innerHtml = dom.innerHTML
|
16
19
|
dom.style.height = toPixel(dom.offsetHeight)
|
17
20
|
dom.style.width = toPixel(dom.offsetWidth)
|
18
21
|
dom.innerHTML = `
|
@@ -28,14 +31,23 @@ export default class Btn {
|
|
28
31
|
}
|
29
32
|
|
30
33
|
hideLoader() {
|
34
|
+
|
35
|
+
if (! this.loading) {
|
36
|
+
return
|
37
|
+
}
|
31
38
|
const { dom } = this
|
32
39
|
dom.style.removeProperty('width')
|
33
40
|
dom.style.removeProperty('height')
|
34
|
-
|
41
|
+
|
42
|
+
const { innerHtml } = this
|
43
|
+
|
44
|
+
if (innerHtml) {
|
45
|
+
dom.innerHTML = innerHtml
|
46
|
+
}
|
35
47
|
}
|
36
48
|
|
37
49
|
setLoading(loading) {
|
38
|
-
this.loading = loading
|
39
50
|
loading ? this.showLoader() : this.hideLoader()
|
51
|
+
this.loading = loading
|
40
52
|
}
|
41
53
|
}
|
@@ -26,6 +26,7 @@ export default class SearchDropdown {
|
|
26
26
|
this.offsetTop = options.offsetTop || 0
|
27
27
|
this.offsetLeft = options.offsetLeft || 0
|
28
28
|
this.noDataMsg = options.noDataMsg || '沒有資料'
|
29
|
+
this.getFloatedTargetPos = options.getFloatedTargetPos || getFloatedTargetPos
|
29
30
|
this.isMenuVisible = false
|
30
31
|
this.lastKeyword = null
|
31
32
|
this.selectedIndex = 0
|
@@ -164,7 +165,7 @@ export default class SearchDropdown {
|
|
164
165
|
|
165
166
|
adjustMenuPos() {
|
166
167
|
const { menu, dom, offset, offsetLeft, offsetTop } = this
|
167
|
-
const { pos, place, align } = getFloatedTargetPos({
|
168
|
+
const { pos, place, align } = this.getFloatedTargetPos({
|
168
169
|
src: dom,
|
169
170
|
target: menu,
|
170
171
|
place: this.place,
|
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.
|
4
|
+
version: 0.0.281
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kmsheng
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-01-
|
12
|
+
date: 2021-01-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sassc
|