chr 0.4.20 → 0.4.21
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
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a5c5749fb984f4bfec7007fcf9d6c0c2a774cd61
|
|
4
|
+
data.tar.gz: 8b83a2e048f2fe170c686d1d2105b6dafe49024c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a6042ffccbf69523f61a269207e7c0a8951766d0c2a0804327c3165f4bee582c89679dd826221a870387ed2275dfe76b36387ce337e7d56c215f48edf36f0ebb
|
|
7
|
+
data.tar.gz: a6cafa19ff1eee0f1a0ee2c0cc3e834de63a3dacf94691ae4d6fe289979b75303a407f5a796a089ee5b7ab5d056891d928c8c54279b4364b8be4cf370d529de2
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
# itemSubtitleField - object attributes name for list item subtitle
|
|
19
19
|
# disableNewItems - do not show new item button in list header
|
|
20
20
|
# disableUpdateItems - do not update list items
|
|
21
|
+
# disableRefresh - do not show refresh button in header
|
|
21
22
|
# onListInit - callback on list is initialized
|
|
22
23
|
# onListShow - callback on list is shown
|
|
23
24
|
# objects - objects array to be added to the store on start
|
|
@@ -71,8 +72,12 @@ class @List
|
|
|
71
72
|
@$header.prepend @$backBtn
|
|
72
73
|
|
|
73
74
|
# spinner & title
|
|
75
|
+
@$title =$ "<span class='title'>#{ @title }</span>"
|
|
74
76
|
@$header.append "<div class='spinner'></div>"
|
|
75
|
-
@$header.append
|
|
77
|
+
@$header.append @$title
|
|
78
|
+
|
|
79
|
+
if @config.arrayStore && !@config.disableRefresh
|
|
80
|
+
@_add_refresh()
|
|
76
81
|
|
|
77
82
|
# new item
|
|
78
83
|
if not @config.disableNewItems and @config.formSchema
|
|
@@ -86,13 +91,20 @@ class @List
|
|
|
86
91
|
|
|
87
92
|
@config.onListInit?(@)
|
|
88
93
|
|
|
89
|
-
|
|
90
94
|
# PRIVATE ===============================================
|
|
91
95
|
|
|
96
|
+
_add_refresh: ->
|
|
97
|
+
@$refreshBtn =$ """<a href='#' class='refresh'>
|
|
98
|
+
<i class='fa fa-refresh'></i>
|
|
99
|
+
</a>"""
|
|
100
|
+
@$title.prepend(@$refreshBtn)
|
|
101
|
+
@$refreshBtn.on "click", (e) =>
|
|
102
|
+
e.preventDefault()
|
|
103
|
+
@updateItems()
|
|
104
|
+
|
|
92
105
|
_bind_hashchange: ->
|
|
93
106
|
$(chr).on 'hashchange', => @_set_active_item()
|
|
94
107
|
|
|
95
|
-
|
|
96
108
|
_set_active_item: ->
|
|
97
109
|
hash = window.location.hash
|
|
98
110
|
if hash.startsWith "#/#{ @module.name }"
|
|
@@ -101,7 +113,6 @@ class @List
|
|
|
101
113
|
if itemPath && hash.startsWith(itemPath)
|
|
102
114
|
return $(a).addClass('active')
|
|
103
115
|
|
|
104
|
-
|
|
105
116
|
# PUBLIC ================================================
|
|
106
117
|
|
|
107
118
|
showSpinner: ->
|
|
@@ -63,7 +63,17 @@ a { text-decoration: none; }
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
.
|
|
66
|
+
.refresh {
|
|
67
|
+
@include position(absolute);
|
|
68
|
+
display: inline-block;
|
|
69
|
+
width: 30px;
|
|
70
|
+
margin-left: -30px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.show-spinner {
|
|
74
|
+
.spinner { visibility: visible; }
|
|
75
|
+
.refresh { visibility: hidden; }
|
|
76
|
+
}
|
|
67
77
|
|
|
68
78
|
/* Item -------------------------------------------------------------------- */
|
|
69
79
|
.item {
|
|
@@ -63,6 +63,14 @@ a {
|
|
|
63
63
|
border-left-color : $positive-color;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
.refresh {
|
|
67
|
+
color: $border-color;
|
|
68
|
+
text-align: center;
|
|
69
|
+
|
|
70
|
+
i { @include position(relative, 4px null null null); }
|
|
71
|
+
&:hover { color: rgba($base-font-color, .4); }
|
|
72
|
+
}
|
|
73
|
+
|
|
66
74
|
.item {
|
|
67
75
|
color : $base-font-color;
|
|
68
76
|
margin-top : -1px;
|
data/lib/chr/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: chr
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.21
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alexander Kravets
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2015-11-
|
|
13
|
+
date: 2015-11-26 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: rails
|