edit_mode 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/assets/javascripts/edit_mode/best_in_place.js.coffee +18 -3
- data/lib/edit_mode/version.rb +1 -1
- data/test_app/README.md +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7f81a093fd36e4bae5eb58771304b06a4f71110
|
4
|
+
data.tar.gz: 5859513add131f4424f3cc4f0dad37737a552f15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e768f992eff2cc2aa237bc3f5933dba8db660ec0f42dc2a0934ea2429b94e759d63a8ed0b6345c8eb4e8bfdaf129d73a395191730542c5f923e727f53203057e
|
7
|
+
data.tar.gz: ee82b068817b59deca80072e97a2f35870c0adc204f8a9e76af34c3e3df2a2a26afe4633d58723ac8398014265de2711b3ed8cb2f50a8eb7e609050913a624d8
|
data/Gemfile.lock
CHANGED
@@ -1,4 +1,17 @@
|
|
1
|
-
|
1
|
+
old_value = (best_in_place)->
|
2
|
+
if best_in_place.data('bip-original-content')?
|
3
|
+
best_in_place.data('bip-original-content')
|
4
|
+
else
|
5
|
+
null
|
6
|
+
|
7
|
+
new_value = (best_in_place)->
|
8
|
+
v = best_in_place.find('input').val() if best_in_place.find('input').length > 0
|
9
|
+
v = best_in_place.find('textarea').text() if best_in_place.find('textarea').length > 0
|
10
|
+
v = best_in_place.find('select').find(":selected").text() if best_in_place.find('select').length > 0
|
11
|
+
v = null if v == ""
|
12
|
+
return v
|
13
|
+
|
14
|
+
$(document).ready ->
|
2
15
|
|
3
16
|
jQuery.fn.apply_best_in_place = ->
|
4
17
|
this.best_in_place()
|
@@ -20,7 +33,10 @@ ready = ->
|
|
20
33
|
)
|
21
34
|
.unbind("save")
|
22
35
|
.bind( "save", (e) ->
|
23
|
-
$(
|
36
|
+
if String(old_value($(this))) != String(new_value($(this)))
|
37
|
+
$(this).data('bestInPlaceEditor').update()
|
38
|
+
else
|
39
|
+
$(this).data('bestInPlaceEditor').abort()
|
24
40
|
e.stopPropagation()
|
25
41
|
)
|
26
42
|
return this
|
@@ -34,4 +50,3 @@ ready = ->
|
|
34
50
|
unless $( event.target ).is( "textarea" )
|
35
51
|
$( this ).closest( ".edit_mode_group" ).trigger( "save" )
|
36
52
|
|
37
|
-
$(document).ready(ready)
|
data/lib/edit_mode/version.rb
CHANGED
data/test_app/README.md
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
test_app/../README.md
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: edit_mode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Fiedlschuster
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -236,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
236
236
|
version: '0'
|
237
237
|
requirements: []
|
238
238
|
rubyforge_project:
|
239
|
-
rubygems_version: 2.
|
239
|
+
rubygems_version: 2.6.12
|
240
240
|
signing_key:
|
241
241
|
specification_version: 4
|
242
242
|
summary: Toggle an edit mode on a show view. Think of it as a grouped in-place editing.
|