diff --git a/public/js/custom.js b/public/js/custom.js index 223bcbc..18249cc 100644 --- a/public/js/custom.js +++ b/public/js/custom.js @@ -23,7 +23,7 @@ $(document).ready(function() { // and pass the tree options as an argument to the fancytree() function: $('#tree').fancytree({ clickFolderMode: 3, - extensions: ['glyph'], + extensions: ['glyph','persist'], autoCollapse: true, // Automatically collapse all siblings, when a node is expanded. autoScroll: true, // Automatically scroll nodes into visible area. focusOnSelect: true, // Set focus when node is checked by a mouse click @@ -31,6 +31,23 @@ $(document).ready(function() { preset: 'bootstrap3', // @todo look at changing this to awesome5 map: {} }, + persist: { + // Available options with their default: + cookieDelimiter: '~', // character used to join key strings + cookiePrefix: undefined, // 'fancytree--' by default + cookie: { // settings passed to jquery.cookie plugin + raw: false, + expires: '', + path: '', + domain: '', + secure: false + }, + expandLazy: true, // true: recursively expand and load lazy nodes + expandOpts: undefined, // optional `opts` argument passed to setExpanded() + overrideSource: true, // true: cookie takes precedence over `source` data attributes. + store: 'auto', // 'cookie': use cookie, 'local': use localStore, 'session': use sessionStore + types: 'active expanded focus selected' // which status types to store + }, click: function(event,data) { if (data.targetType == 'title') { $.ajax({ diff --git a/resources/js/app.js b/resources/js/app.js index d81f4c3..9b527d1 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -9,8 +9,9 @@ import {createTree} from 'jquery.fancytree'; import 'jquery.fancytree/dist/modules/jquery.fancytree.edit'; import 'jquery.fancytree/dist/modules/jquery.fancytree.filter'; import 'jquery.fancytree/dist/modules/jquery.fancytree.glyph'; +import 'jquery.fancytree/dist/modules/jquery.fancytree.persist'; // import 'jquery-ui/dist/jquery-ui'; // USED? -import 'jquery.fancytree/dist/skin-xp/ui.fancytree.min.css'; +import 'jquery.fancytree/dist/skin-xp/ui.fancytree.css'; // Bootstrap - included in architectui // import 'bootstrap/dist/js/bootstrap.bundle';