volt-editable-text 0.0.7 → 0.0.8

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: 35bc21a467358205e883ff295daa9d085f2cce0a
4
- data.tar.gz: cc50fab06158a48e9aea41da0150517800c0c47c
3
+ metadata.gz: b955889bf9512e56fa87cb4d90570c8c9dfca0fb
4
+ data.tar.gz: 589d3efa0185b8b41b461aee33bd6211d27e5fa2
5
5
  SHA512:
6
- metadata.gz: b70c30ed7afa0eae30f152bfd960076369dedf8e894149919cf80a5e5683da14050931030997a6794c9f5412bb9033a17e5cdfc8a754aebb9460b558a719a9af
7
- data.tar.gz: 95f5a7803b536238052c37469526aad5d7425a621bf2f3df6e63749e0f4cf16c242ac7e688d7977b6cbe5a8c96c362ad3906731a4ff3a6920078c54b9e2abeaf
6
+ metadata.gz: 27e26e97116bc621ec8a3392623db1858494c6a019020f316a41efeb8a94e09a0687b5b7ce10a301f8c26949eccbe15c05a3d04484e8a0b132c41e05d097c6c3
7
+ data.tar.gz: 5ee8dda1271b989b2d84487ef8774e19e8c9359a4dda420a9340c9a1c54bd3559b300276b6c021b63ede719eea704f95c585e6d59d5fcbc24255f90ee370c163
data/README.md CHANGED
@@ -18,4 +18,4 @@ Then require it as a component in any components' dependencies.rb you want to us
18
18
 
19
19
  Finally, use the tag.
20
20
 
21
- <:editable-text value="{_some_value}" />
21
+ <:editable-text value="{{_some_value}}" />
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.7
1
+ 0.0.8
@@ -1,13 +1,10 @@
1
1
  module EditableText
2
2
  class MainController < ModelController
3
3
  attr_accessor :section
4
+ reactive_accessor :toggled
4
5
 
5
6
  def index
6
- @toggled = ReactiveValue.new(false)
7
- end
8
-
9
- def toggled
10
- @toggled
7
+ self.toggled = false
11
8
  end
12
9
 
13
10
  def body_element
@@ -15,9 +12,9 @@ module EditableText
15
12
  end
16
13
 
17
14
  def toggle_editing
18
- controller._toggled = (!controller._toggled).cur
15
+ self.toggled = !toggled
19
16
 
20
- if controller._toggled.cur
17
+ if toggled
21
18
  # Editing enabled, bind a listener for when they click on the document to disable
22
19
  # it again.
23
20
  body_element.on('click.editabletext') do |event|
@@ -36,10 +33,26 @@ module EditableText
36
33
 
37
34
  def edit(event)
38
35
  if event.key_code == 13
39
- event.stop
36
+ #for some reason .stop or stop_propagation thow the following error:
37
+ #undefined method `stop_propagation' for #<Volt::JSEvent:7672>
38
+
39
+ #event.stop_propagation
40
40
 
41
41
  toggle_editing
42
42
  end
43
43
  end
44
+
45
+ def value=(newvalue)
46
+ attrs.value = newvalue
47
+ end
48
+
49
+ def value
50
+ return attrs.value
51
+ end
52
+
53
+ def size
54
+ return attrs.value.size
55
+ end
56
+
44
57
  end
45
58
  end
@@ -1,6 +1,6 @@
1
1
  <:Body>
2
- {#if controller._toggled}
3
- <input type="text" e-keypress="edit(event)" value="{@value}" />
4
- {#else}
5
- <span e-click="toggle_editing">{@value}</span>
6
- {/}
2
+ {{if toggled}}
3
+ <input type="text" e-keypress="edit(event)" size="{{size}}" value="{{value}}" />
4
+ {{else}}
5
+ <span e-click="toggle_editing">{{value}}</span>
6
+ {{end}}
@@ -19,6 +19,6 @@ Gem::Specification.new do |spec|
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_development_dependency "volt", "~> 0.7.0"
22
+ spec.add_development_dependency "volt", "~> 0.8.23"
23
23
  spec.add_development_dependency "rake"
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: volt-editable-text
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Stout
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-17 00:00:00.000000000 Z
11
+ date: 2014-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: volt
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.7.0
19
+ version: 0.8.23
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.7.0
26
+ version: 0.8.23
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  version: '0'
75
75
  requirements: []
76
76
  rubyforge_project:
77
- rubygems_version: 2.2.0
77
+ rubygems_version: 2.2.2
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: Volt component that gives a :editable-text control which shows text, and