volt-easypiechart 0.2.0 → 0.3.0

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: d480b9c6a327d12d77777b5b1db904cd83132faf
4
- data.tar.gz: a8e79c5dd89b07ece5850f03b0a0f2929f6e3901
3
+ metadata.gz: 7cba5456dfdd26aa15c1a63f069bc57e300408e6
4
+ data.tar.gz: b3aa0ee0e2382318d7f53a998b7e99db7b704412
5
5
  SHA512:
6
- metadata.gz: e22a72e5bba7f3eb90084b926d38bcdc194bb9f12d17ce3acfee3014082414252d385ffefa67c7d4c3082c4f13ca4a77ecf7feaf0a851bf537e958a751d14577
7
- data.tar.gz: b2ab2bbad92d3b619a0a3c24cc79bc0bdc1cf3935c150c638f1521ee76836de3ec0d4a5347ec2ecbe32acc1fd4f3e6641974fbdb88a39e19eb2bcdf9127bcec8
6
+ metadata.gz: 38ce6243c02ba0ef26809a00940c678fa0fc2751fe412e56bdc4e5d6637c28f197435671c4e25acc516b779b0dc7c38d345f24335d2253dfc81f8247bd712af7
7
+ data.tar.gz: ee83067bb442d74a93ae1acf91dbb5c96b8b77224c36e3b6cfcfc831d252298c85c8ffce905d4d2ef7c8813f126689084a3bcf9fc46f1dfb97a9088783080853
@@ -0,0 +1,29 @@
1
+ .easy-pie {
2
+ position: relative;
3
+ display: inline-block;
4
+ text-align: center;
5
+ canvas {
6
+ position: absolute;
7
+ top: 0;
8
+ left: 0;
9
+ }
10
+ .percent {
11
+ display: inline-block;
12
+ vertical-align: middle;
13
+ z-index: 2;
14
+ font-size: 1.2em;
15
+ }
16
+ .percent:after {
17
+ content: '%';
18
+ margin-left: 0.1em;
19
+ font-size: .9em;
20
+ }
21
+ .label {
22
+ text-align: center;
23
+ color: #333;
24
+ font-weight: 300;
25
+ font-size: 1.2em;
26
+ margin: 0;
27
+ padding: 0;
28
+ }
29
+ }
@@ -3,11 +3,17 @@ module Easypiechart
3
3
 
4
4
  def index_ready
5
5
  @watches = []
6
- @elem = `$("#" + #{first_element}.id)`
6
+ @elem = `$(#{first_element}).children().first()`
7
7
  if @elem
8
8
  if attrs.options
9
9
  begin
10
10
  JSON.parse(attrs.options).each do |option, value|
11
+ if option == 'size'
12
+ value_in_px = "#{value}px"
13
+ `#{@elem}.css("height",#{value_in_px});`
14
+ `#{@elem}.css("width",#{value_in_px});`
15
+ `#{@elem}.css("line-height",#{value_in_px});`
16
+ end
11
17
  `#{@elem}.data(#{option}, #{value})`
12
18
  end
13
19
  rescue Object => e
@@ -21,7 +27,9 @@ module Easypiechart
21
27
 
22
28
  def update_value
23
29
  if @elem
24
- `#{@elem}.data('easyPieChart').update(#{attrs.percent})`
30
+ attrs.percent.then do |percent|
31
+ `#{@elem}.data('easyPieChart').update(#{percent})`
32
+ end
25
33
  end
26
34
  end
27
35
 
@@ -1,7 +1,9 @@
1
1
  <:Body>
2
2
  <div class="easy-pie {{ attrs.classes }}" data-percent="{{ attrs.percent }}">
3
- <div class="percent">{{ attrs.percent }}</div>
3
+ <div class="chart">
4
+ <div class="percent">{{ attrs.percent }}</div>
5
+ </div>
4
6
  {{ if attrs.pie_title }}
5
- <div class="pie-title">{{ attrs.pie_title }}</div>
7
+ <div class="label">{{ attrs.pie_title }}</div>
6
8
  {{ end }}
7
9
  </div>
@@ -1,5 +1,5 @@
1
1
  module Volt
2
2
  module Easypiechart
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: volt-easypiechart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Hale
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-22 00:00:00.000000000 Z
11
+ date: 2016-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: volt
@@ -206,6 +206,7 @@ files:
206
206
  - LICENSE.txt
207
207
  - README.md
208
208
  - Rakefile
209
+ - app/easypiechart/assets/css/main.css.scss
209
210
  - app/easypiechart/assets/js/jquery.easypiechart.js
210
211
  - app/easypiechart/config/dependencies.rb
211
212
  - app/easypiechart/config/initializers/boot.rb