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 +4 -4
- data/README.md +1 -1
- data/VERSION +1 -1
- data/app/editable-text/controllers/main_controller.rb +21 -8
- data/app/editable-text/views/main/index.html +5 -5
- data/volt-editable-text.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b955889bf9512e56fa87cb4d90570c8c9dfca0fb
|
4
|
+
data.tar.gz: 589d3efa0185b8b41b461aee33bd6211d27e5fa2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27e26e97116bc621ec8a3392623db1858494c6a019020f316a41efeb8a94e09a0687b5b7ce10a301f8c26949eccbe15c05a3d04484e8a0b132c41e05d097c6c3
|
7
|
+
data.tar.gz: 5ee8dda1271b989b2d84487ef8774e19e8c9359a4dda420a9340c9a1c54bd3559b300276b6c021b63ede719eea704f95c585e6d59d5fcbc24255f90ee370c163
|
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
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
|
-
|
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
|
-
|
15
|
+
self.toggled = !toggled
|
19
16
|
|
20
|
-
if
|
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
|
-
|
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
|
-
{
|
3
|
-
<input type="text" e-keypress="edit(event)" value="{
|
4
|
-
{
|
5
|
-
<span e-click="toggle_editing">{
|
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}}
|
data/volt-editable-text.gemspec
CHANGED
@@ -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.
|
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.
|
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
|
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.
|
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.
|
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.
|
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
|