tao_ui 0.1.1 → 0.1.2

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: 3cd476c93bc4131dbe7c16a288872d5a92d2f352
4
- data.tar.gz: 4612c60fb7f72416c8e2ec51d41a223468ee1756
3
+ metadata.gz: b88a6a39098b20aa0f10643b591d5ccfb8f0a369
4
+ data.tar.gz: 21051f04bdf01faa0d570d7537458054645256fa
5
5
  SHA512:
6
- metadata.gz: 4d46fb579e0be58c6372e685011532383e3ef6c63af73032445ef6871d7afcf7c9727da2ac8bba0380d36f5017bc67119354e9dfbc5c73263f2aaf6d178b54c2
7
- data.tar.gz: df30315a7fc29594af690d2619c3512a3f2a092d8c07fe91c51542f41f4b2472134121c80e22805248263e95af16d772ad8dbaca2dd5e7b540ac3dbed2d0c1ab
6
+ metadata.gz: 2e44337766dca61ff03b13763c70dd3a3b540f3108be6557fc7c839adb2179801d3ec9c37929a4f453b6e1eefd33c41b34a11bd2ed07f99d4dbaeefd2670ac53
7
+ data.tar.gz: 0ee13fefb88aed8d2d5b1fda1dedbe06375eb50fba00d9c584435724ee7ebf4f4c7417e6eec6d82e1a8f45d03b09de9fa3b2c427611e4c11d9359608e36ed53f
File without changes
@@ -1,4 +1,5 @@
1
1
  #= require_self
2
+ #= require ./ujs
2
3
  #= require ./icons
3
4
 
4
5
  window.Tao ||= {}
@@ -1,4 +1,5 @@
1
1
  #= require_self
2
+ #= require ../ujs
2
3
  #= require ../icons
3
4
 
4
5
  window.Tao ||= {}
@@ -0,0 +1,28 @@
1
+ # hack ujs for adding loading icon on disabled buttons/links
2
+
3
+ prependLoadingIcon = (element) ->
4
+ $(element).prepend Tao.ui.iconTag('loading', class: 'spin')
5
+
6
+ # jquery-ujs
7
+ if $.rails?
8
+ originDisableElement = $.rails.disableElement
9
+ $.rails.disableElement = (element) ->
10
+ originDisableElement element
11
+ prependLoadingIcon element
12
+
13
+ originDisableFormElement = $.rails.disableFormElement
14
+ $.rails.disableFormElement = (element) ->
15
+ originDisableFormElement element
16
+ prependLoadingIcon element
17
+
18
+ # rails-ujs
19
+ else if Rails?
20
+ originDisableElement = Rails.disableElement
21
+ Rails.disableElement = (e) ->
22
+ originDisableElement e
23
+ element = if e instanceof Event then e.target else e
24
+ if Rails.matches(element, Rails.formSubmitSelector)
25
+ Rails.formElements(element, Rails.formDisableSelector).forEach (el) ->
26
+ prependLoadingIcon el
27
+ else
28
+ prependLoadingIcon element
@@ -1,9 +1,7 @@
1
1
  @import 'tao/ui/globals';
2
2
 
3
3
  .button {
4
- display: inline-flex;
5
- align-items: center;
6
- justify-content: center;
4
+ display: inline-block;
7
5
  padding: $button-padding;
8
6
  font-size: $button-font-size;
9
7
  line-height: $button-line-height;
@@ -18,9 +16,8 @@
18
16
  @include button-colors($default-button-colors);
19
17
 
20
18
  .icon {
21
- width: 1em;
22
- height: 1em;
23
- margin: 0 0.4em 0 0;
19
+ vertical-align: text-top;
20
+ margin-right: 0.4em;
24
21
  }
25
22
 
26
23
  &:focus, &.focus {
@@ -57,7 +54,7 @@
57
54
  }
58
55
 
59
56
  &.button-block {
60
- display: flex;
57
+ display: block;
61
58
  width: 100%;
62
59
  }
63
60
  }
@@ -7,8 +7,8 @@
7
7
 
8
8
  .icon {
9
9
  display: inline-block;
10
- width: 1em;
11
- height: 1em;
10
+ width: 1.25em;
11
+ height: 1.25em;
12
12
  vertical-align: middle;
13
13
  fill: inherit;
14
14
 
@@ -1,9 +1,9 @@
1
1
  $button-font-size: $font-size !default;
2
- $button-line-height: 1.375 !default;
2
+ $button-line-height: 1.5 !default;
3
3
  $button-padding: 0.5em 1em !default;
4
4
 
5
- $small-button-font-size: $font-size-s !default;
6
- $small-button-line-height: 1.3 !default;
5
+ $small-button-font-size: $font-size-xs !default;
6
+ $small-button-line-height: 1.5 !default;
7
7
  $small-button-padding: 0.25em 0.5em !default;
8
8
 
9
9
  $default-button-colors: (
@@ -1,2 +1,2 @@
1
- $table-border-color: #eeeeee;
2
- $table-row-hover-color: $lighter-grey-bg-color;
1
+ $table-border-color: #eeeeee !default;
2
+ $table-row-hover-color: $lighter-grey-bg-color !default;
@@ -1,3 +1,3 @@
1
1
  module TaoUi
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tao_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - farthinker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-18 00:00:00.000000000 Z
11
+ date: 2017-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -68,11 +68,12 @@ files:
68
68
  - LICENSE
69
69
  - README.md
70
70
  - Rakefile
71
- - lib/assets/icons/Loading.svg
71
+ - lib/assets/icons/loading.svg
72
72
  - lib/assets/javascripts/tao/ui/icons/basic.coffee
73
73
  - lib/assets/javascripts/tao/ui/icons/index.coffee
74
74
  - lib/assets/javascripts/tao/ui/index.coffee
75
75
  - lib/assets/javascripts/tao/ui/mobile/index.coffee
76
+ - lib/assets/javascripts/tao/ui/ujs.coffee
76
77
  - lib/assets/stylesheets/tao/ui/_custom.scss
77
78
  - lib/assets/stylesheets/tao/ui/_globals.scss
78
79
  - lib/assets/stylesheets/tao/ui/_mixins.scss