inplace_editing 0.1.3 → 0.1.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25aeffb75b1e41393b090a7e0f3205bb1cee5319
|
4
|
+
data.tar.gz: 5259bac3efb39ab2b11b8ebcadd577768b449706
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fc78dafd845b2e0282e306b9c2dd739776c8077384d6d7d7719cd57a5b5bca7c4aec8d3e92d805fb1e4e8d0848da64fa3e8ca16422577d9f392698dec300862
|
7
|
+
data.tar.gz: 91c2859744af480916c45b39cd3ab336270db0c236df8ba6aeb785946d7cd29901bde216d6b49c9ecbd9bb636f6b327e02c31ad9b18ac07e9f455959edd31874
|
@@ -6,10 +6,10 @@
|
|
6
6
|
.image-container
|
7
7
|
img.preview.editable-preview src="#{image_src}" style="#{image_src.blank? ? 'display:none' : ''}"
|
8
8
|
- if image_src.blank?
|
9
|
-
a.insert-image href="
|
9
|
+
a.insert-image href="" Clique para inserir imagem
|
10
10
|
.actions-container style="display:none;"
|
11
|
-
input.saveButton type="submit"
|
12
|
-
input.cancelButton type="button"
|
11
|
+
input.saveButton type="submit" value="Salvar"
|
12
|
+
input.cancelButton type="button" value="Cancelar"
|
13
13
|
javascript:
|
14
14
|
$(document).ready(function() {
|
15
15
|
var form_id = "#{form_id}";
|
@@ -26,7 +26,11 @@ function asyncImageForm(config) {
|
|
26
26
|
});
|
27
27
|
|
28
28
|
$(config.imageChangerSelector).click(function(e){
|
29
|
+
if(typeof e.preventDefault === 'function')
|
30
|
+
e.preventDefault();
|
31
|
+
|
29
32
|
$(config.inputFileSelector).click();
|
33
|
+
return false;
|
30
34
|
});
|
31
35
|
|
32
36
|
$(config.formSelector).submit(function (event) {
|
@@ -54,4 +58,23 @@ function asyncImageForm(config) {
|
|
54
58
|
|
55
59
|
return false;
|
56
60
|
});
|
57
|
-
};
|
61
|
+
};
|
62
|
+
|
63
|
+
function setImagePreview(input, imageElement, noImageElement) {
|
64
|
+
if (input.files && input.files[0]) {
|
65
|
+
var reader = new FileReader();
|
66
|
+
|
67
|
+
reader.onload = function (e) {
|
68
|
+
if (noImageElement)
|
69
|
+
noImageElement.hide();
|
70
|
+
imageElement.attr('src', e.target.result);
|
71
|
+
imageElement.show();
|
72
|
+
}
|
73
|
+
|
74
|
+
reader.readAsDataURL(input.files[0]);
|
75
|
+
} else {
|
76
|
+
if (noImageElement)
|
77
|
+
noImageElement.show();
|
78
|
+
imageElement.hide();
|
79
|
+
}
|
80
|
+
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inplace_editing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henrique Rangel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|