edit_mode 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
@@ -2,19 +2,22 @@
|
|
2
2
|
jQuery ->
|
3
3
|
$( ".best_in_place" ).best_in_place()
|
4
4
|
.addClass( "editable ")
|
5
|
-
.bind( "edit", ->
|
5
|
+
.bind( "edit", (e) ->
|
6
6
|
$( this ).data( 'bestInPlaceEditor' ).activate()
|
7
7
|
$( this ).find( "*" ).unbind( 'blur' )
|
8
8
|
.unbind( 'click' )
|
9
9
|
.unbind( 'keyup' )
|
10
10
|
.unbind( 'submit' )
|
11
11
|
.bind( 'keyup', keyUpHandler )
|
12
|
+
e.stopPropagation()
|
12
13
|
)
|
13
|
-
.bind( "cancel", ->
|
14
|
+
.bind( "cancel", (e) ->
|
14
15
|
$( this ).data( 'bestInPlaceEditor' ).abort()
|
16
|
+
e.stopPropagation()
|
15
17
|
)
|
16
|
-
.bind( "save", ->
|
18
|
+
.bind( "save", (e) ->
|
17
19
|
$( this ).data( 'bestInPlaceEditor' ).update()
|
20
|
+
e.stopPropagation()
|
18
21
|
)
|
19
22
|
|
20
23
|
keyUpHandler = (event) ->
|
@@ -22,4 +25,5 @@ jQuery ->
|
|
22
25
|
$( this ).closest( ".edit_mode_group" ).trigger( "cancel" )
|
23
26
|
if event.keyCode == 13
|
24
27
|
unless $( event.target ).is( "textarea" )
|
25
|
-
$( this ).closest( ".edit_mode_group" ).trigger( "save" )
|
28
|
+
$( this ).closest( ".edit_mode_group" ).trigger( "save" )
|
29
|
+
|
@@ -4,8 +4,7 @@ jQuery ->
|
|
4
4
|
# The <span class="edit_mode_group"></span> elements receive 'edit', 'save' and 'cancel' events,
|
5
5
|
# when the user clicks the corresponding buttons '.edit_button', '.save_button' or '.cancel_button'.
|
6
6
|
# The edit_mode_group has to pass these events down to the contained .editable elements.
|
7
|
-
$( ".edit_mode_group" ).bind( "edit", ->
|
8
|
-
|
7
|
+
$( ".edit_mode_group" ).bind( "edit", (e) ->
|
9
8
|
unless $( this ).hasClass( "currently_in_edit_mode" )
|
10
9
|
$( this ).addClass( "currently_in_edit_mode" )
|
11
10
|
|
data/lib/edit_mode/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: edit_mode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirement: &74896990 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,15 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.2'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ! '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '3.2'
|
24
|
+
version_requirements: *74896990
|
30
25
|
- !ruby/object:Gem::Dependency
|
31
26
|
name: jquery-rails
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
27
|
+
requirement: &74896660 !ruby/object:Gem::Requirement
|
33
28
|
none: false
|
34
29
|
requirements:
|
35
30
|
- - ! '>='
|
@@ -37,15 +32,10 @@ dependencies:
|
|
37
32
|
version: '0'
|
38
33
|
type: :runtime
|
39
34
|
prerelease: false
|
40
|
-
version_requirements:
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ! '>='
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
35
|
+
version_requirements: *74896660
|
46
36
|
- !ruby/object:Gem::Dependency
|
47
37
|
name: rake
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
38
|
+
requirement: &74896300 !ruby/object:Gem::Requirement
|
49
39
|
none: false
|
50
40
|
requirements:
|
51
41
|
- - ! '>='
|
@@ -53,15 +43,10 @@ dependencies:
|
|
53
43
|
version: '0'
|
54
44
|
type: :development
|
55
45
|
prerelease: false
|
56
|
-
version_requirements:
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- - ! '>='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
46
|
+
version_requirements: *74896300
|
62
47
|
- !ruby/object:Gem::Dependency
|
63
48
|
name: rspec-rails
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
49
|
+
requirement: &74895810 !ruby/object:Gem::Requirement
|
65
50
|
none: false
|
66
51
|
requirements:
|
67
52
|
- - ! '>='
|
@@ -69,15 +54,10 @@ dependencies:
|
|
69
54
|
version: 2.8.0
|
70
55
|
type: :development
|
71
56
|
prerelease: false
|
72
|
-
version_requirements:
|
73
|
-
none: false
|
74
|
-
requirements:
|
75
|
-
- - ! '>='
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: 2.8.0
|
57
|
+
version_requirements: *74895810
|
78
58
|
- !ruby/object:Gem::Dependency
|
79
59
|
name: nokogiri
|
80
|
-
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirement: &74895390 !ruby/object:Gem::Requirement
|
81
61
|
none: false
|
82
62
|
requirements:
|
83
63
|
- - ! '>='
|
@@ -85,15 +65,10 @@ dependencies:
|
|
85
65
|
version: 1.5.0
|
86
66
|
type: :development
|
87
67
|
prerelease: false
|
88
|
-
version_requirements:
|
89
|
-
none: false
|
90
|
-
requirements:
|
91
|
-
- - ! '>='
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: 1.5.0
|
68
|
+
version_requirements: *74895390
|
94
69
|
- !ruby/object:Gem::Dependency
|
95
70
|
name: capybara
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirement: &74895040 !ruby/object:Gem::Requirement
|
97
72
|
none: false
|
98
73
|
requirements:
|
99
74
|
- - ! '>='
|
@@ -101,12 +76,7 @@ dependencies:
|
|
101
76
|
version: '0'
|
102
77
|
type: :development
|
103
78
|
prerelease: false
|
104
|
-
version_requirements:
|
105
|
-
none: false
|
106
|
-
requirements:
|
107
|
-
- - ! '>='
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '0'
|
79
|
+
version_requirements: *74895040
|
110
80
|
description: The edit mode is activated by pressing an 'edit' button on a show view.
|
111
81
|
This shows additional editing tools and switches on the best_in_place form fields.
|
112
82
|
When editing is finished, use 'save' or 'cancel' buttons to quit the edit mode and
|
@@ -232,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
232
202
|
version: '0'
|
233
203
|
requirements: []
|
234
204
|
rubyforge_project:
|
235
|
-
rubygems_version: 1.8.
|
205
|
+
rubygems_version: 1.8.11
|
236
206
|
signing_key:
|
237
207
|
specification_version: 3
|
238
208
|
summary: Toggle an edit mode on a show view. Think of it as a grouped in-place editing.
|