Commit 3c59a9944ac6d0ec8b6df75aa3ddc410f88a8ac7

Authored by Victor Costa
1 parent 03d5c15c

Fix block store initialization

app/views/box_organizer/index.html.erb
@@ -27,3 +27,5 @@ @@ -27,3 +27,5 @@
27 </div> 27 </div>
28 </div> 28 </div>
29 <div id="block-store-draggables"></div> 29 <div id="block-store-draggables"></div>
  30 +
  31 +<script>initBlockStore();</script>
public/javascripts/block-store.js
@@ -12,8 +12,8 @@ function stopDragBlock() { @@ -12,8 +12,8 @@ function stopDragBlock() {
12 $('.ui-draggable-dragging').removeClass('ui-draggable-dragging'); 12 $('.ui-draggable-dragging').removeClass('ui-draggable-dragging');
13 } 13 }
14 14
15 -jQuery(document).ready(function($) {  
16 - var store = $('#block-store #block-types').slick({ 15 +function initBlockStore() {
  16 + var store = jQuery('#block-store #block-types').slick({
17 infinite: true, 17 infinite: true,
18 dots: true, 18 dots: true,
19 draggable: false, 19 draggable: false,
@@ -37,4 +37,5 @@ jQuery(document).ready(function($) { @@ -37,4 +37,5 @@ jQuery(document).ready(function($) {
37 } 37 }
38 ] 38 ]
39 }); 39 });
40 -}); 40 + jQuery('#block-store').show();
  41 +}
public/stylesheets/block-store.css
@@ -27,6 +27,9 @@ @@ -27,6 +27,9 @@
27 /************************************************ 27 /************************************************
28 * block store styles 28 * block store styles
29 ************************************************/ 29 ************************************************/
  30 +#block-store {
  31 + display: none;
  32 +}
30 #content #block-store .block-type { 33 #content #block-store .block-type {
31 position: relative; 34 position: relative;
32 border: 0px solid #AAA; 35 border: 0px solid #AAA;