refinerycms-page-images 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/gemspec.rb +1 -1
- data/public/javascripts/page-image-picker.js +16 -12
- metadata +3 -3
data/lib/gemspec.rb
CHANGED
@@ -21,18 +21,6 @@ $(document).ready(function(){
|
|
21
21
|
reset_functionality();
|
22
22
|
});
|
23
23
|
|
24
|
-
reindex_images = function() {
|
25
|
-
$('#page_images li input:hidden').each(function(i, input){
|
26
|
-
// make the image's name consistent with its position.
|
27
|
-
parts = $(input).attr('name').split(']');
|
28
|
-
parts[1] = ('[' + i)
|
29
|
-
$(input).attr('name', parts.join(']'));
|
30
|
-
|
31
|
-
// make the image's id consistent with its position.
|
32
|
-
$(input).attr('id', $(input).attr('id').replace(/_\d_/, '_'+i+'_').replace(/_\d/, '_'+i));
|
33
|
-
});
|
34
|
-
}
|
35
|
-
|
36
24
|
reset_functionality = function() {
|
37
25
|
$("#page_images").sortable({
|
38
26
|
'tolerance': 'pointer'
|
@@ -86,6 +74,7 @@ image_added = function(image) {
|
|
86
74
|
, src: result.url
|
87
75
|
}).appendTo(current_list_item);
|
88
76
|
}
|
77
|
+
|
89
78
|
},
|
90
79
|
error: function(xhr, txt, status) {
|
91
80
|
if (console && console.log) {
|
@@ -100,4 +89,19 @@ image_added = function(image) {
|
|
100
89
|
current_list_item.attr('id', 'image_' + image_id).removeClass('empty');
|
101
90
|
|
102
91
|
new_list_item.appendTo($('#page_images'));
|
92
|
+
reindex_images();
|
93
|
+
}
|
94
|
+
|
95
|
+
reindex_images = function() {
|
96
|
+
alert("reindexing images");
|
97
|
+
$('#page_images li input:hidden').each(function(i, input){
|
98
|
+
|
99
|
+
// make the image's name consistent with its position.
|
100
|
+
parts = $(input).attr('name').split(']');
|
101
|
+
parts[1] = ('[' + i)
|
102
|
+
$(input).attr('name', parts.join(']'));
|
103
|
+
|
104
|
+
// make the image's id consistent with its position.
|
105
|
+
$(input).attr('id', $(input).attr('id').replace(/_\d_/, '_'+i+'_').replace(/_\d/, '_'+i));
|
106
|
+
});
|
103
107
|
}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refinerycms-page-images
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 63
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 2
|
10
|
+
version: 0.9.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Resolve Digital
|