formagic 0.3.2 → 0.3.3

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: 858582d325b96ce81957334910bfd8dda51990c7
4
- data.tar.gz: 5cbfd2d64d8acc6fbd149d1bded6b079bde89459
3
+ metadata.gz: 1232cfe4348b90ec411f702c7047b5ef9293b73e
4
+ data.tar.gz: f4e4defe3db6b66b51c71bfd65c70627b9bf1139
5
5
  SHA512:
6
- metadata.gz: 7643bde4754ccf1cbc4439138e443f94be6e4b0c56c2a994b5d6466bf03bd1576b01a86326418ee16993935e0019c6e17bcb6ae6ddfcf0f581b78a0f0069ff39
7
- data.tar.gz: 9d84e483df4eb91ed3d38a414654e21dd3994e59a99082b7e6bc4b4fa467627e4b2c904bf474d3b566df03e635d2b94a88d6c45e446340dd15a7d0915259adf1
6
+ metadata.gz: 62ec94089f8b9f6d48c0e91b8314a8aacd1c147b5e1a4d0335dd2e6fc59f7739059e791106d021454c33313c4891a8685c450ed3071a237e30efaa358be6c879
7
+ data.tar.gz: 170fc20d96fa30268a7c82599ccdefbf65b58012c2e38fa12821be074d2b15a690abc99eb243a879cc54e6ef3a0076b86b0faaae13d3894eb06ccd3af0e79023
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- formagic (0.3.2)
4
+ formagic (0.3.3)
5
5
  bourbon (>= 3.2)
6
6
  normalize-rails (>= 3.0)
7
7
 
@@ -7,7 +7,7 @@
7
7
  # -----------------------------------------------------------------------------
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
- # INPUT LIST
10
+ # INPUT ARRAY
11
11
  # -----------------------------------------------------------------------------
12
12
  # Allows to create/delete/reorder list items connected to dynamic or static
13
13
  # collection. Value should be an array of objects.
@@ -67,9 +67,11 @@ class @InputArray extends InputString
67
67
 
68
68
  _render_item: (o) ->
69
69
  value = _escapeHtml(o)
70
-
71
70
  listItem =$ """<li data-value='#{ value }'>
72
- <span class='icon-reorder' data-container-class='#{ @reorderContainerClass }'></span>
71
+ <span class='icon-reorder'
72
+ data-container-class='#{ @reorderContainerClass }'>
73
+ #{ Icons.reorderDocuments }
74
+ </span>
73
75
  #{ value }
74
76
  <a href='#' class='action_remove'>Remove</a>
75
77
  </li>"""
@@ -54,7 +54,11 @@
54
54
 
55
55
 
56
56
  _add_form_reorder_button: (form) ->
57
- form.$el.prepend("""<div class='icon-reorder' data-container-class='#{@reorderContainerClass}'></div>""").addClass('reorderable')
57
+ reorderIcon = """<div class='icon-reorder'
58
+ data-container-class='#{@reorderContainerClass}'>
59
+ #{ Icons.reorderDocuments }
60
+ </div>"""
61
+ form.$el.prepend(reorderIcon).addClass('reorderable')
58
62
 
59
63
 
60
64
  _find_form_by_target: (el) ->
@@ -89,7 +89,10 @@ class @InputList extends InputString
89
89
  item = o[@config.titleFieldName]
90
90
 
91
91
  listItem =$ """<li data-id='#{ o._id }'>
92
- <span class='icon-reorder' data-container-class='#{ @reorderContainerClass }'></span>
92
+ <span class='icon-reorder'
93
+ data-container-class='#{ @reorderContainerClass }'>
94
+ #{ Icons.reorderDocuments }
95
+ </span>
93
96
  #{ item }
94
97
  <a href='#' class='action_remove'>Remove</a>
95
98
  </li>"""
@@ -145,7 +148,3 @@ include(InputList, inputListTypeahead)
145
148
 
146
149
 
147
150
  chr.formInputs['list'] = InputList
148
-
149
-
150
-
151
-
@@ -23,4 +23,7 @@
23
23
  ## OPTIONAL
24
24
  # require ./formagic/inputs/redactor
25
25
  # require ./formagic/inputs/html
26
- # require ./formagic/inputs/markdown
26
+ # require ./formagic/inputs/markdown
27
+
28
+ @Icons ?= {}
29
+ @Icons.reorderDocuments = "<i class='fa fa-ellipsis-v'></i>"
@@ -2,50 +2,37 @@
2
2
 
3
3
  .input-array {
4
4
  input {
5
- padding-left : 2.5em;
6
- margin-top : .25em;
5
+ padding-left: 2.5em;
6
+ margin-top: .25em;
7
7
  }
8
8
 
9
9
  ul {
10
- margin : 0 0 0 2.5em;
11
- padding : 0;
12
- list-style : none;
13
- line-height : 1.5;
10
+ margin: 0 0 0 1em;
11
+ padding: 0;
12
+ list-style: none;
13
+ line-height: 1.5;
14
14
 
15
15
  li {
16
16
  @include user-select(none); position: relative;
17
17
 
18
18
  a {
19
- color : $formagic-assertive-color;
20
- font-size : .75em;
19
+ color: $formagic-assertive-color;
20
+ font-size: 0.75em;
21
21
  &:hover {
22
- opacity : .5;
22
+ opacity: 0.5;
23
23
  }
24
24
  }
25
25
  }
26
26
  }
27
27
 
28
28
  .slip-reordering {
29
- color : $formagic-positive-color;
29
+ color: $formagic-positive-color;
30
30
  }
31
31
 
32
32
  .icon-reorder {
33
- @include position(absolute);
34
- left : -2.5em;
35
- height : 1.5em;
36
- &:before {
37
- background-position : 10px 3px;
38
- height : 1.5em;
39
- }
33
+ @include reorder-icon-base();
34
+ margin-left: -20px;
35
+ width: 20px;
36
+ &:hover { color: $formagic-positive-color; }
40
37
  }
41
-
42
- // input:after {
43
- // content: '+';
44
- // display: block;
45
- // width: 40px;
46
- // height: 24px;
47
- // position: absolute; left: 12px; top: -3px;
48
- // font-size: 22px;
49
- // color: $formagic-border-color;
50
- // }
51
38
  }
@@ -28,6 +28,7 @@
28
28
  }
29
29
 
30
30
  .icon-reorder {
31
+ // TODO: this should be refactored as well to use fontawesome icon
31
32
  height : 25px;
32
33
  width : 25px;
33
34
  left : -1.75em;
@@ -22,18 +22,21 @@
22
22
  }
23
23
 
24
24
  & > ul > li > .icon-reorder {
25
- @include position(absolute);
26
- z-index : 1;
27
- left : 0;
28
- top : 1em;
25
+ @include reorder-icon-base();
26
+ right: 0;
27
+ top: 20px;
28
+ margin-right: -30px;
29
+ line-height: 40px;
30
+ width: 30px;
31
+
32
+ &:hover {
33
+ color: $formagic-positive-color;
34
+ }
29
35
  }
30
36
 
31
37
  & > ul li.reorderable {
38
+ margin-right: 0.75em;
32
39
  background-color : white;
33
-
34
- & > .form-input:first-of-type {
35
- padding-left : 2.5em;
36
- }
37
40
  }
38
41
  }
39
42
 
@@ -53,24 +56,23 @@
53
56
  }
54
57
 
55
58
  .nested-form-delete {
56
- @include position(absolute, .35em .3em null null);
59
+ @include position(absolute, 0 -1.5em null null);
57
60
  @include hide-text;
58
61
 
59
- background-color : rgba(0,0,0,.05);
60
- border-radius : 1em;
61
- z-index : 1;
62
- height : 1.5em;
63
- width : 1.5em;
62
+ border-radius: 1em;
63
+ height: 1.25em;
64
+ width: 1.25em;
65
+ z-index: 1;
66
+ line-height: 1;
64
67
 
65
68
  &:before {
66
- @include position(absolute, null .45em null null);
67
- line-height : 1.35em;
68
- content : '\00d7';
69
- color : $formagic-label-color;
69
+ @include position(absolute, null .325em null null);
70
+ content: '\00d7';
71
+ color: $formagic-label-color;
70
72
  }
71
73
 
72
74
  &:hover {
73
- background-color : $formagic-positive-color;
75
+ background-color : $formagic-assertive-color;
74
76
 
75
77
  &:before {
76
78
  color : white;
@@ -45,21 +45,11 @@ $formagic-border-color : #eee !default;
45
45
  border : none;
46
46
  }
47
47
 
48
- @mixin icon-reorder($color) {
49
- display : block;
50
- height : 40px;
51
- width : 40px;
52
-
53
- &:before {
54
- content : '';
55
- display : block;
56
- height : 40px;
57
- width : 40px;
58
- background-position : 10px 10px;
59
- background-repeat : no-repeat;
60
- background-image : url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><line x1='0' y1='8' x2='20' y2='8' stroke-width='2' stroke='#{ $color }' /><line x1='0' y1='12' x2='20' y2='12' stroke-width='2' stroke='#{ $color }' /></svg>");
61
- background-size : 20px 20px;
62
- }
48
+ @mixin reorder-icon-base {
49
+ @include position(absolute);
50
+ text-align: center;
51
+ z-index: 10;
52
+ cursor: pointer;
63
53
  }
64
54
 
65
55
  @import "formagic/form";
@@ -77,6 +67,3 @@ $formagic-border-color : #eee !default;
77
67
  @import "formagic/switch";
78
68
  @import "formagic/text";
79
69
  @import "formagic/array";
80
-
81
-
82
-
@@ -1,3 +1,3 @@
1
1
  module Formagic
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formagic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kravets
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-23 00:00:00.000000000 Z
11
+ date: 2015-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bourbon