1 2$(function () { 3 4 /*--------------------------------------------------------------------- 5 Basic Tree 6 -----------------------------------------------------------------------*/ 7 $('.basic-tree li:has(ul)').addClass('t-parent').find(' > span').attr('title', 'Collapse this branch'); 8 $('.basic-tree li.t-parent > span').on('click', function (e) { 9 var children = $(this).parent('li.t-parent').find(' > ul > li'); 10 if (children.is(":visible")) { 11 children.hide('fast'); 12 $(this).attr('title', 'Expand this branch').find(' > i').addClass('fa-plus').removeClass('fa-minus'); 13 } else { 14 children.show('fast'); 15 $(this).attr('title', 'Collapse this branch').find(' > i').addClass('fa-minus').removeClass('fa-plus'); 16 } 17 e.stopPropagation(); 18 }); 19 20 /*--------------------------------------------------------------------- 21 Checkbox Tree 22 -----------------------------------------------------------------------*/ 23 jQuery('#flex-tree-check').flexTree({ 24 type: 'checkbox', 25 name: 'foo[]', 26 collapsed: false, 27 items: [ 28 { 29 label: 'Item 1', 30 childrens: [ 31 { 32 label: 'Item 1.1', 33 value: 'item_1_1', 34 checked: true 35 }, 36 37 { 38 label: 'Item 1.2', 39 value: 'item_1_2', 40 childrens: [ 41 { 42 label: 'Item 1.2.1', 43 value: 'item_1_2_1', 44 childrens: [ 45 { 46 label: 'Item 1.2.2.1', 47 value: 'item_1_2_2_1' 48 }, 49 50 { 51 label: 'Item 1.2.2.2', 52 value: 'item_1_2_2_2', 53 id: 'foo' 54 }] 55 }, 56 { 57 label: 'Item 1.2.2', 58 value: 'item_1_2_2' 59 }] 60 }, 61 { 62 label: 'Item 1.3', 63 value: 'item_1_3', 64 checked: true 65 }] 66 }, 67 { 68 label: 'Item 2', 69 childrens: [ 70 { 71 label: 'Item 2.1', 72 value: 'item_2_1', 73 checked: true 74 }] 75 }] 76 }); 77 }); 78 79 80 81 82
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.