Sha256: d8fb3a1ebe8139acfb1bd356a08bcb957b8205c1127051554b3146671fb127ca

Contents?: true

Size: 1.22 KB

Versions: 13

Compression:

Stored size: 1.22 KB

Contents

:javascript
  function get_panel_blocks(){
    //var x = get_current_tab().find('#panel-blocks').first();
    return $('#panel-blocks').first();
  }

  function init_panel_blocks(path){
    return load_panel_blocks(path);
  }

  function load_panel_blocks(path){
    var lang = get_current_tab_lang();

    //
    var r = Math.random();

    $.get("#{panel_blocks_templates_path}?path="+encodeURIComponent(path)+"&r="+r, function(data, status){
      get_panel_blocks().html(data);
    });
  }

  $(document).ready(function() {
    $( ".tab-content" ).on( "click", "#panel-blocks a.link_block_insert", function( e ) {
      e.preventDefault();

      var lang = get_current_tab_lang();
      var name = lang;
      if (name==""){
        name = "def";
      }

      //$( "#target" ).click();
      var text = "=block '"+$(this).data('path')+"'";
      editors[name].insert(text);
    }); // click

    // filter blocks
    $( ".tab-content" ).on( "keypress", "#panel-blocks-input-path", function( e ) {
      var key = e.which;
      if(key == 13){
        //$('input[name = butAssignProd]').click();
        var v = $(this).val();
        load_panel_blocks(v);
        return false;
      }
    });
  });

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
optimacms-0.3.35 app/views/optimacms/admin/templates/_js_editor_panel_blocks.html.haml
optimacms-0.3.34 app/views/optimacms/admin/templates/_js_editor_panel_blocks.html.haml
optimacms-0.3.30 app/views/optimacms/admin/templates/_js_editor_panel_blocks.html.haml
optimacms-0.3.29 app/views/optimacms/admin/templates/_js_editor_panel_blocks.html.haml
optimacms-0.3.23 app/views/optimacms/admin/templates/_js_editor_panel_blocks.html.haml
optimacms-0.3.15 app/views/optimacms/admin/templates/_js_editor_panel_blocks.html.haml
optimacms-0.3.12 app/views/optimacms/admin/templates/_js_editor_panel_blocks.html.haml
optimacms-0.3.11 app/views/optimacms/admin/templates/_js_editor_panel_blocks.html.haml
optimacms-0.2.26 app/views/optimacms/admin/templates/_js_editor_panel_blocks.html.haml
optimacms-0.2.25 app/views/optimacms/admin/templates/_js_editor_panel_blocks.html.haml
optimacms-0.2.24 app/views/optimacms/admin/templates/_js_editor_panel_blocks.html.haml
optimacms-0.3.4 app/views/optimacms/admin/templates/_js_editor_panel_blocks.html.haml
optimacms-0.3.3 app/views/optimacms/admin/templates/_js_editor_panel_blocks.html.haml