inplace_editing 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af9809a8aa1b4f9994ac291b3d5e207ab7a25f50
4
- data.tar.gz: c63cead7fda8cf827fb587620bff9f0209b9efae
3
+ metadata.gz: 3322f5a36479f3f208d97e10cdc24c2436e771ff
4
+ data.tar.gz: b41171b97c155430ef4e1304af0419069eb6f52c
5
5
  SHA512:
6
- metadata.gz: 345cc6b9651d2c172e2013b33f3b900675ce495abf8191dddf527c8770a14ae0d2d752433581e74dda8700cd5fc8b117865ca8c627b0e7829a6637116cb7e3b4
7
- data.tar.gz: 4069bcf5bb5ec120333f2c925bc05ac5fc67dbf1422f92bf0541bef74db77012de78ee257e2627afd077511bb6c1c87295251e1f7b13fb2c0341081d9b16d847
6
+ metadata.gz: c8c109a1cce1715a9fada084017ab970ac897922909ac18a6895487003cf213a486057c80364d85e3708d2b39bed42f068cdd6e9a09d2bafad6b1038e9309520
7
+ data.tar.gz: 0365158acc73ce47f9f178b56d5ccb43664181e7140ac631b36e3d11f25e9a0bf50a808a2d77ad851ee2f78e280916e66cc5f2ca7b9fc399d94b3c730c8e6f1a
@@ -50,6 +50,7 @@ var InplaceEditingManager = {
50
50
  }
51
51
 
52
52
  function asyncImageForm(config) {
53
+ var image_form = this;
53
54
  this.config = config;
54
55
  this.config.setConfigOrSelector = function(prefix) {
55
56
  var self = this;
@@ -78,7 +79,7 @@ function asyncImageForm(config) {
78
79
 
79
80
  var elementProperties = ['form', 'inputFile', 'imagePreview', 'imageChanger'];
80
81
  for (var i = 0; i < elementProperties.length; i++) {
81
- this.config.setConfigOrSelector(elementProperties[i]);
82
+ image_form.config.setConfigOrSelector(elementProperties[i]);
82
83
  }
83
84
 
84
85
  function defaultPostImageSuccess() {
@@ -86,26 +87,26 @@ function asyncImageForm(config) {
86
87
  return false;
87
88
  };
88
89
 
89
- config.inputFileElement.change(function(){
90
- setImagePreview(this, config.imagePreviewElement);
91
- config.events.imageChanged(this);
90
+ image_form.config.inputFileElement.change(function(){
91
+ setImagePreview(this, image_form.config.imagePreviewElement);
92
+ image_form.config.events.imageChanged(this);
92
93
  });
93
94
 
94
- config.imageChangerElement.click(function(e){
95
+ image_form.config.imageChangerElement.click(function(e){
95
96
  if(typeof e.preventDefault === 'function')
96
97
  e.preventDefault();
97
98
 
98
- config.inputFileElement.click();
99
+ image_form.config.inputFileElement.click();
99
100
  return false;
100
101
  });
101
102
 
102
- config.formElement.submit(function (event) {
103
+ image_form.config.formElement.submit(function (event) {
103
104
  event.preventDefault();
104
105
 
105
106
  //grab all form data
106
107
  var formData = new FormData($(this)[0]);
107
108
 
108
- config.events.imageUploading(this);
109
+ image_form.config.events.imageUploading(this);
109
110
 
110
111
  $.ajax({
111
112
  url: $(this).attr('action'),
@@ -115,10 +116,10 @@ function asyncImageForm(config) {
115
116
  contentType: false,
116
117
  processData: false,
117
118
  success: function (responseData) {
118
- config.events.imageUploadSuccess(responseData);
119
+ image_form.config.events.imageUploadSuccess(responseData);
119
120
  },
120
121
  error: function () {
121
- config.events.imageUploadFail(this);
122
+ image_form.config.events.imageUploadFail(this);
122
123
  }
123
124
  });
124
125
 
@@ -1,3 +1,3 @@
1
1
  module InplaceEditing
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inplace_editing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henrique Rangel