Sha256: e03aef49ce4ef9c7b9b4e7e12d19ef8338dedfa20faadfbd2f96ff43d9a9d969

Contents?: true

Size: 1.28 KB

Versions: 9

Compression:

Stored size: 1.28 KB

Contents

<script type="text/javascript">
  $(function () {
    $("#treeview")
    .jstree({
      "plugins" : [
        "themes","html_data","ui","dnd"
      ],
      "core" : {
        "initially_open" : [<%= opened_node %>]
      }
    })
    .bind("move_node.jstree", function (e, data) {
      data.rslt.o.each(function (i) {
        $.ajax({
          async : false,
          type: 'POST',
          url: "/admin/<%= plural_model_name %>/" + $(this).data("id") + "/treeview_update",
            data : {
              "operation" : "move_node",
              "<%= model_name %>_id" : data.rslt.cr === -1 ? "" : data.rslt.np.data("id"),
              "position" : data.rslt.cp + i,
              "title" : data.rslt.name,
              "copy" : data.rslt.cy ? 1 : 0
            },
            success : function (r) {
              $(data.rslt.oc).attr("id", "treeelt_" + r.id);
              if(data.rslt.cy && $(data.rslt.oc).children("UL").length) {
                data.inst.refresh(data.inst._get_parent(data.rslt.oc));
              }
            },
            error : function (r) {
              $.jstree.rollback(data.rlbk);
            }
        });
      });
    });
    //$("#jstree-marker-line").remove();
  });
</script>
<style type="text/css">
  #jstree-marker-line {pointer-events: none;}
</style>

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
beautiful_scaffold-0.2.4 lib/generators/templates/app/views/_treeview_js.html.erb
beautiful_scaffold-0.2.3 lib/generators/templates/app/views/_treeview_js.html.erb
beautiful_scaffold-0.2.2 lib/generators/templates/app/views/_treeview_js.html.erb
beautiful_scaffold-0.2.1 lib/generators/templates/app/views/_treeview_js.html.erb
beautiful_scaffold-0.2.0 lib/generators/templates/app/views/_treeview_js.html.erb
beautiful_scaffold-0.1.9 lib/generators/templates/app/views/_treeview_js.html.erb
beautiful_scaffold-0.1.8 lib/generators/templates/app/views/_treeview_js.html.erb
beautiful_scaffold-0.1.7 lib/generators/templates/app/views/_treeview_js.html.erb
beautiful_scaffold-0.1.5 lib/generators/templates/app/views/_treeview_js.html.erb