curo-material-interface 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9273680f368bf201ceb441bbd2b57773a9f7a983
|
4
|
+
data.tar.gz: d057d97799312f01c5516d626578015d7f5f6111
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 364b0bcff4358ff2097a1869b721c683bf51341cc31b39f429ef140902d086fea53feb3d55eefbc54cf841e5d5e3917b0189aa1d68d145feff46da098a004f26
|
7
|
+
data.tar.gz: add5fe92f3c67e573e306a8fd61f6361427ebfffedb83931e5a3ef29375583e833203e5538ae1b8efa95afd3c5d0778ccb581361420d62b23b4a03e47e18da4d
|
@@ -100,13 +100,14 @@ class CMI.FormComponents.Select
|
|
100
100
|
Math.max(document.documentElement.clientHeight, window.innerHeight || 0)
|
101
101
|
|
102
102
|
getViewportScrollY: ->
|
103
|
-
window.
|
103
|
+
window.pageYOffset
|
104
104
|
|
105
105
|
updateDropdownListPosition: ->
|
106
106
|
offset = @getInput().offset()
|
107
107
|
width = @getInput().width()
|
108
108
|
|
109
109
|
# reset
|
110
|
+
@getDropdownList().removeClass 'cmi-select-list-scroll'
|
110
111
|
@getDropdownList().css
|
111
112
|
height: 'auto'
|
112
113
|
top: 0
|
@@ -129,13 +130,14 @@ class CMI.FormComponents.Select
|
|
129
130
|
pos.top = @getViewportScrollY()
|
130
131
|
|
131
132
|
# fix if bottom is outside viewport
|
132
|
-
if pos.top + dropdownHeight > @
|
133
|
-
pos.bottom =
|
133
|
+
if pos.top + dropdownHeight > @getViewportScrollY() + @getViewportHeight()
|
134
|
+
pos.bottom = @getViewportScrollY() * -1
|
134
135
|
pos.top = null if pos.top > @getViewportScrollY()
|
135
136
|
|
136
137
|
# fix if top is outside viewport
|
137
138
|
if pos.top == null && dropdownHeight > @getViewportHeight()
|
138
139
|
pos.top = @getViewportScrollY()
|
140
|
+
@getDropdownList().addClass 'cmi-select-list-scroll'
|
139
141
|
|
140
142
|
# set position
|
141
143
|
pos.top = if pos.top == null then 'auto' else "#{pos.top}px"
|
@@ -219,7 +221,7 @@ class CMI.FormComponents.Select
|
|
219
221
|
content = ' ' if content.length <= 0
|
220
222
|
options.push "<li data-cmi-value='#{$(option).val()}'>#{content}</li>"
|
221
223
|
|
222
|
-
dropdownList = $("<
|
224
|
+
dropdownList = $("<div class='cmi-select-list'><ul>#{options.join('')}</ul></div>")
|
223
225
|
|
224
226
|
@domElement.data 'cmi-select-dropdown-list', dropdownList
|
225
227
|
$('body').append dropdownList
|
@@ -17,16 +17,28 @@
|
|
17
17
|
cursor: pointer
|
18
18
|
|
19
19
|
.cmi-select-list
|
20
|
+
+box-sizing(border-box)
|
20
21
|
+position(absolute, 0 auto auto 0)
|
21
22
|
+cmi-box-shadow(0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12))
|
22
23
|
display: none
|
23
|
-
overflow:
|
24
|
+
overflow: none
|
25
|
+
white-space: normal
|
24
26
|
z-index: 800
|
25
|
-
list-style: none
|
26
27
|
margin: 16px 0 16px 0
|
27
28
|
padding: 0
|
28
29
|
background-color: #fff
|
29
30
|
pointer-events: none
|
31
|
+
&.cmi-select-list-scroll
|
32
|
+
overflow: auto
|
33
|
+
overflow-y: scroll
|
34
|
+
ul
|
35
|
+
+box-sizing(border-box)
|
36
|
+
margin: 0
|
37
|
+
padding: 0
|
38
|
+
list-style: none
|
39
|
+
background-color: #fff
|
40
|
+
pointer-events: none
|
41
|
+
white-space: normal
|
30
42
|
li
|
31
43
|
+user-select(none)
|
32
44
|
padding: 10px 15px
|
@@ -51,7 +63,7 @@
|
|
51
63
|
.cmi-select-list.cmi-select-open
|
52
64
|
display: block
|
53
65
|
pointer-events: all
|
54
|
-
li
|
66
|
+
ul, li
|
55
67
|
cursor: pointer
|
56
68
|
pointer-events: all
|
57
69
|
|