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 +4 -4
- data/lib/assets/javascripts/inplace_editing.js +11 -10
- data/lib/inplace_editing/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3322f5a36479f3f208d97e10cdc24c2436e771ff
|
4
|
+
data.tar.gz: b41171b97c155430ef4e1304af0419069eb6f52c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
|