edit_mode 1.0.4 → 1.0.5

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: f7f81a093fd36e4bae5eb58771304b06a4f71110
4
- data.tar.gz: 5859513add131f4424f3cc4f0dad37737a552f15
3
+ metadata.gz: 2abbbd1ee56ad6b5b4526db285f126db718c0239
4
+ data.tar.gz: ca6691373d55f4bbfca3e0b9773e8df5db0f1c63
5
5
  SHA512:
6
- metadata.gz: e768f992eff2cc2aa237bc3f5933dba8db660ec0f42dc2a0934ea2429b94e759d63a8ed0b6345c8eb4e8bfdaf129d73a395191730542c5f923e727f53203057e
7
- data.tar.gz: ee82b068817b59deca80072e97a2f35870c0adc204f8a9e76af34c3e3df2a2a26afe4633d58723ac8398014265de2711b3ed8cb2f50a8eb7e609050913a624d8
6
+ metadata.gz: 1320660acdb7d19f27fbe70763b27bb6aaac80bd864c0f7f951363c3daf87cf7b3154615ef1926f6c713c118bf39aa26ac3a443300594e79d3589a239c8d48f0
7
+ data.tar.gz: 50d4e85f52083c9302df12684fcbe9f4952889246072c8568e9edec22d1bed1cb9637ef64a97b6cd35bddddefff18327f81b66c20f749d52c43efa9b1d998995
@@ -9,7 +9,7 @@ GIT
9
9
  PATH
10
10
  remote: .
11
11
  specs:
12
- edit_mode (1.0.4)
12
+ edit_mode (1.0.5)
13
13
  jquery-rails
14
14
  jquery-turbolinks
15
15
  rails (>= 3.2)
@@ -1,16 +1,3 @@
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
1
  $(document).ready ->
15
2
 
16
3
  jQuery.fn.apply_best_in_place = ->
@@ -43,10 +30,22 @@ $(document).ready ->
43
30
 
44
31
  $( ".best_in_place" ).apply_best_in_place()
45
32
 
33
+ old_value = (best_in_place)->
34
+ if best_in_place.data('bip-original-content')?
35
+ best_in_place.data('bip-original-content')
36
+ else
37
+ null
38
+
39
+ new_value = (best_in_place)->
40
+ v = best_in_place.find('input').val() if best_in_place.find('input').length > 0
41
+ v = best_in_place.find('textarea').val() if best_in_place.find('textarea').length > 0
42
+ v = best_in_place.find('select').find(":selected").text() if best_in_place.find('select').length > 0
43
+ v = null if v == ""
44
+ return v
45
+
46
46
  keyUpHandler = (event) ->
47
47
  if event.keyCode == 27
48
48
  $( this ).closest( ".edit_mode_group" ).trigger( "cancel" )
49
49
  if event.keyCode == 13
50
50
  unless $( event.target ).is( "textarea" )
51
51
  $( this ).closest( ".edit_mode_group" ).trigger( "save" )
52
-
@@ -1,3 +1,3 @@
1
1
  module EditMode
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
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: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Fiedlschuster