caboose-cms 0.5.30 → 0.5.31
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/assets/javascripts/caboose/admin_page_edit_content.js +42 -23
- data/lib/caboose/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MmNiOTkyNWRjMjA0ZmI0YmRmYWY3NmI3Zjk4ZjlmMTI5OWI3NGUwNg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YmUwMzY1NTJjNDg4N2U4NGE0M2NjODhjYTBiMDU2M2Q2M2YxZTdiYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGJmYWJjYThjMDkwMDg2ZjM4Y2YwN2YwNjE1MDdmZjc5NzM4OGUzOGQzOTU4
|
10
|
+
ZjNlMDM3MjhhYzdjMjQwNDRiMzIzYWFkNzc2N2M5MTQ3MzUzMDlmNDZjYTE0
|
11
|
+
OTY3Mzc2ZTEyZTkwMzE5NTVmN2M5MzVjOWNiYzEzN2I5NTFlMjM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Nzc1MzNlOWYzMzBmZjk5YTMyMTVmMjQwMmRiMDU1NjM2NTE4NDQxZDRmZDdi
|
14
|
+
NTg5YThkOGYyNmRlZDhjYTYzMjI1ZjQ5MTQwNWZiZDg5MmYzZWJiYzk2MGM4
|
15
|
+
ODgyMGRhNzM1NTUwOTE0NTBmZWViYTU0NWJhMTJmNGRkZjVlNGI=
|
@@ -179,15 +179,16 @@ PageContentController.prototype = {
|
|
179
179
|
var that = this;
|
180
180
|
$.ajax({
|
181
181
|
url: '/admin/pages/' + this.page_id + '/blocks/tree',
|
182
|
-
success: function(blocks) {
|
182
|
+
success: function(blocks) {
|
183
|
+
var count = blocks.length;
|
183
184
|
$(blocks).each(function(i,b) {
|
184
|
-
that.set_clickable_helper(b, false, false);
|
185
|
+
that.set_clickable_helper(b, false, false, (i == count-1));
|
185
186
|
});
|
186
187
|
}
|
187
188
|
});
|
188
189
|
},
|
189
190
|
|
190
|
-
set_clickable_helper: function(b, parent_id, parent_allows_child_blocks)
|
191
|
+
set_clickable_helper: function(b, parent_id, parent_allows_child_blocks, is_last_child)
|
191
192
|
{
|
192
193
|
var that = this;
|
193
194
|
|
@@ -212,7 +213,24 @@ PageContentController.prototype = {
|
|
212
213
|
)
|
213
214
|
.mouseover(function(e) { $(this).removeClass('new_block_link').addClass('new_block_link_over'); e.stopPropagation(); })
|
214
215
|
.mouseout(function(e) { $(this).removeClass('new_block_link_over').addClass('new_block_link'); e.stopPropagation(); })
|
215
|
-
);
|
216
|
+
);
|
217
|
+
if (is_last_child && is_last_child == true)
|
218
|
+
{
|
219
|
+
$('#block_' + b.id).append($('<div/>')
|
220
|
+
.addClass('new_block_link')
|
221
|
+
.append($('<div/>').addClass('line'))
|
222
|
+
.append($('<a/>')
|
223
|
+
.attr('href', '#')
|
224
|
+
.html("New Block")
|
225
|
+
.click(function(e) {
|
226
|
+
e.preventDefault(); e.stopPropagation();
|
227
|
+
caboose_modal_url('/admin/pages/' + that.page_id + '/blocks/' + parent_id + '/new?after_id=' + b.id);
|
228
|
+
})
|
229
|
+
)
|
230
|
+
.mouseover(function(e) { $(this).removeClass('new_block_link').addClass('new_block_link_over'); e.stopPropagation(); })
|
231
|
+
.mouseout(function(e) { $(this).removeClass('new_block_link_over').addClass('new_block_link'); e.stopPropagation(); })
|
232
|
+
);
|
233
|
+
}
|
216
234
|
}
|
217
235
|
|
218
236
|
$('#block_' + b.id).attr('onclick','').unbind('click');
|
@@ -223,30 +241,31 @@ PageContentController.prototype = {
|
|
223
241
|
|
224
242
|
var show_mouseover = true;
|
225
243
|
if (b.children && b.children.length > 0)
|
226
|
-
{
|
244
|
+
{
|
245
|
+
var count = b.children.length;
|
227
246
|
$.each(b.children, function(i, b2) {
|
228
247
|
if (b2.field_type == 'block')
|
229
248
|
show_mouseover = false;
|
230
|
-
that.set_clickable_helper(b2, b.id, b.allow_child_blocks);
|
249
|
+
that.set_clickable_helper(b2, b.id, b.allow_child_blocks, i == (count-1));
|
231
250
|
});
|
232
251
|
}
|
233
|
-
if (b.allow_child_blocks)
|
234
|
-
{
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
}
|
252
|
+
//if (b.allow_child_blocks)
|
253
|
+
//{
|
254
|
+
// $('#block_' + b.id).after($('<div/>')
|
255
|
+
// .addClass('new_block_link')
|
256
|
+
// .append($('<div/>').addClass('line'))
|
257
|
+
// .append($('<a/>')
|
258
|
+
// .attr('href', '#')
|
259
|
+
// .html("New Block")
|
260
|
+
// .click(function(e) {
|
261
|
+
// e.preventDefault(); e.stopPropagation();
|
262
|
+
// caboose_modal_url('/admin/pages/' + that.page_id + '/blocks/' + b.id + '/new?after_id=' + b.id);
|
263
|
+
// })
|
264
|
+
// )
|
265
|
+
// .mouseover(function(e) { $(this).removeClass('new_block_link').addClass('new_block_link_over'); e.stopPropagation(); })
|
266
|
+
// .mouseout(function(e) { $(this).removeClass('new_block_link_over').addClass('new_block_link'); e.stopPropagation(); })
|
267
|
+
// );
|
268
|
+
//}
|
250
269
|
if (show_mouseover)
|
251
270
|
{
|
252
271
|
$('#block_' + b.id).mouseover(function(el) { $('#block_' + b.id).addClass( 'block_over'); });
|
data/lib/caboose/version.rb
CHANGED