Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy functions to data, fixes #1016 #1017

Merged
merged 6 commits into from
Jul 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* [Fixed] #1001 Invalid urls in skin-xp CSS
* [Changed] #1005 Cast key to string in getNodeByKey()
* [Added] #1012 `dnd5.dropMarkerParent` allows usage in Webcomponents (i.e. shadow DOM)
* [Added] #1017 `copyFunctionsToData` allows also copying functions to the data property of the node

# 2.35.0 / 2020-03-27
* [Changed] The `enableAspx` option will default to 'false' in the future.
Expand Down
33 changes: 15 additions & 18 deletions src/jquery.fancytree.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,8 @@
for (name in obj) {
if (
!NODE_ATTR_MAP[name] &&
!$.isFunction(obj[name]) &&
(this.tree.options.copyFunctionsToData ||
!$.isFunction(obj[name])) &&
!NONE_NODE_DATA_MAP[name]
) {
// node.data.NAME = obj.NAME
Expand Down Expand Up @@ -6263,20 +6264,16 @@
autoScroll: false,
checkbox: false,
clickFolderMode: 4,
copyFunctionsToData: false,
debugLevel: null, // 0..4 (null: use global setting $.ui.fancytree.debugLevel)
disabled: false, // TODO: required anymore?
enableAspx: 42, // TODO: this is truethy, but distinguishable from true: default will change to false in the future
escapeTitles: false,
extensions: [],
// fx: { height: "toggle", duration: 200 },
// toggleEffect: { effect: "drop", options: {direction: "left"}, duration: 200 },
// toggleEffect: { effect: "slide", options: {direction: "up"}, duration: 200 },
//toggleEffect: { effect: "blind", options: {direction: "vertical", scale: "box"}, duration: 200 },
toggleEffect: { effect: "slideToggle", duration: 200 }, //< "toggle" or "slideToggle" to use jQuery instead of jQueryUI for toggleEffect animation
focusOnSelect: false,
generateIds: false,
icon: true,
idPrefix: "ft_",
focusOnSelect: false,
keyboard: true,
keyPathSeparator: "/",
minExpandLevel: 1,
Expand All @@ -6294,29 +6291,29 @@
},
tabindex: "0",
titlesTabbable: false,
toggleEffect: { effect: "slideToggle", duration: 200 }, //< "toggle" or "slideToggle" to use jQuery instead of jQueryUI for toggleEffect animation
tooltip: false,
treeId: null,
_classNames: {
node: "fancytree-node",
folder: "fancytree-folder",
active: "fancytree-active",
animating: "fancytree-animating",
combinedExpanderPrefix: "fancytree-exp-",
combinedIconPrefix: "fancytree-ico-",
hasChildren: "fancytree-has-children",
active: "fancytree-active",
selected: "fancytree-selected",
error: "fancytree-error",
expanded: "fancytree-expanded",
lazy: "fancytree-lazy",
focused: "fancytree-focused",
folder: "fancytree-folder",
hasChildren: "fancytree-has-children",
lastsib: "fancytree-lastsib",
lazy: "fancytree-lazy",
loading: "fancytree-loading",
node: "fancytree-node",
partload: "fancytree-partload",
partsel: "fancytree-partsel",
radio: "fancytree-radio",
// radiogroup: "fancytree-radiogroup",
unselectable: "fancytree-unselectable",
lastsib: "fancytree-lastsib",
loading: "fancytree-loading",
error: "fancytree-error",
selected: "fancytree-selected",
statusNodePrefix: "fancytree-statusnode-",
unselectable: "fancytree-unselectable",
},
// events
lazyLoad: null,
Expand Down
1 change: 1 addition & 0 deletions src/jsdoc-globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ var TreePatch = {};
* Recommended place to store shared data for column rendering.
* See also <a href="https://github.com/mar10/fancytree/wiki/ExtTable">table extension</a>.
* @since 2.27
* @property {boolean} copyFunctionsToData Copy also functions to the node's data property (default: false)
* @property {Integer} debugLevel 0..4 (null: use global setting $.ui.fancytree.debugLevel)
* @property {function} defaultKey callback(node) is called for new nodes without a key. Must return a new unique key. (default null: generates default keys like that: "_" + counter)
* @property {boolean} <del>enableAspx</del> Accept passing ajax data in a property named `d` (default: true).
Expand Down