volt-editable-text 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/editable-text/controllers/index_controller.rb +4 -11
- data/app/editable-text/views/index/index.html +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d3165f891893aea9ba5adfe7a985c0ecfa0c736
|
4
|
+
data.tar.gz: 473371238b10134bde4099dc048397f3a29388cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59e30cbe4dbe7108f7879fb1bf07bc4893cfc498fa9aefd9513643702f4b09981f02b0ed564fb2ff696db2ae24cca9cc86a247803d586515e3f06e3fa2c82476
|
7
|
+
data.tar.gz: 90a2d95475d1e7b01a9184909de01f213d34121fab309e4ece0b05c0a55c0d3a9b0ec23b1578f4289665593102270f9b6bb431836a921f525023dbdd22c7e396
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
@@ -1,29 +1,22 @@
|
|
1
1
|
module EditableText
|
2
2
|
class IndexController < ModelController
|
3
|
-
model :page
|
4
|
-
|
5
|
-
attr_reader :data
|
6
3
|
attr_accessor :section
|
7
4
|
|
8
|
-
def
|
9
|
-
super
|
10
|
-
|
11
|
-
@data = data
|
12
|
-
|
5
|
+
def index
|
13
6
|
@toggled = ReactiveValue.new(false)
|
14
7
|
end
|
15
8
|
|
16
9
|
def toggled
|
17
10
|
@toggled
|
18
11
|
end
|
19
|
-
|
12
|
+
|
20
13
|
def body_element
|
21
14
|
Element.find('body')
|
22
15
|
end
|
23
16
|
|
24
17
|
def toggle_editing
|
25
18
|
controller._toggled = (!controller._toggled).cur
|
26
|
-
|
19
|
+
|
27
20
|
if controller._toggled.cur
|
28
21
|
# Editing enabled, bind a listener for when they click on the document to disable
|
29
22
|
# it again.
|
@@ -44,7 +37,7 @@ module EditableText
|
|
44
37
|
def edit(event)
|
45
38
|
if event.key_code == 13
|
46
39
|
event.stop
|
47
|
-
|
40
|
+
|
48
41
|
toggle_editing
|
49
42
|
end
|
50
43
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<:Body>
|
2
2
|
{#if controller._toggled}
|
3
|
-
<input type="text" e-keypress="edit(event)" value="{
|
3
|
+
<input type="text" e-keypress="edit(event)" value="{@value}" />
|
4
4
|
{#else}
|
5
|
-
<span e-click="toggle_editing">{
|
5
|
+
<span e-click="toggle_editing">{@value}</span>
|
6
6
|
{/}
|
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.3
|
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-
|
11
|
+
date: 2014-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: volt
|