hallo_rails 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -28,7 +28,7 @@ Add this to your sass styles:
28
28
  @import 'hallo_rails';
29
29
 
30
30
  You also need to supply styles for the editor icons.
31
- Good Icons are included in http://fortawesome.github.com/Font-Awesome/
31
+ Good icons are included in http://fortawesome.github.com/Font-Awesome/
32
32
 
33
33
  Just download it and add the styles and font files to your app and you are good to go.
34
34
 
@@ -46,7 +46,9 @@ Within a form use
46
46
 
47
47
  And make sure to call
48
48
 
49
- HalloRails.init() after the dom has loaded, e.g. like:
49
+ HalloRails.init()
50
+
51
+ after the dom has loaded, e.g. like:
50
52
 
51
53
  jQuery ->
52
54
  HalloRails.init()
@@ -1,3 +1,3 @@
1
1
  module HalloRails
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -19,12 +19,15 @@ init = ->
19
19
  options = $el.data('editable-options') || context.default_options
20
20
  $.extend options, { plugins: plugins }
21
21
  $el.hallo options
22
+ $el.data('original-content', $el.html())
22
23
  $el.click ->
23
24
  $(this).focus() # required for firefox as otherwise when clicking on edit overlay element doesn't focus
24
25
 
25
26
  $('body').on "hallodeactivated", '.editable', ->
26
27
  $el = $(this)
27
28
 
29
+ return if $el.data('original-content') == $el.html()
30
+
28
31
  data = {}
29
32
  method_data = {}
30
33
  method_data[$el.data('method')] = $el.html()
@@ -42,6 +45,7 @@ init = ->
42
45
  beforeSend: ->
43
46
  $el.addClass('hallo_updating')
44
47
  success: ->
48
+ $el.data('original-content', $el.html())
45
49
  $el.removeClass('hallo_updating')
46
50
  error: (jqXHR, textStatus, errorThrown) ->
47
51
  $el.trigger('hallo:error', [jqXHR.responseText])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hallo_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -60,7 +60,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
60
60
  version: '0'
61
61
  segments:
62
62
  - 0
63
- hash: -18270218963625160
63
+ hash: 3745294668526414569
64
64
  required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  version: '0'
70
70
  segments:
71
71
  - 0
72
- hash: -18270218963625160
72
+ hash: 3745294668526414569
73
73
  requirements: []
74
74
  rubyforge_project:
75
75
  rubygems_version: 1.8.24