fancytree 2.33.0

This commit is contained in:
zadam 2019-10-29 19:07:05 +01:00
parent d50e072ea4
commit a2a53deb94
5 changed files with 91 additions and 74 deletions

View File

@ -1,4 +1,4 @@
/*! jQuery Fancytree Plugin - 2.32.0 - 2019-09-10T07:42:12Z /*! jQuery Fancytree Plugin - 2.33.0 - 2019-10-29T08:00:07Z
* https://github.com/mar10/fancytree * https://github.com/mar10/fancytree
* Copyright (c) 2019 Martin Wendt; Licensed MIT * Copyright (c) 2019 Martin Wendt; Licensed MIT
*/ */
@ -1365,8 +1365,8 @@ var uniqueId = $.fn.extend( {
* Released under the MIT license * Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo * https://github.com/mar10/fancytree/wiki/LicenseInfo
* *
* @version 2.32.0 * @version 2.33.0
* @date 2019-09-10T07:42:12Z * @date 2019-10-29T08:00:07Z
*/ */
/** Core Fancytree module. /** Core Fancytree module.
@ -2947,15 +2947,7 @@ var uniqueId = $.fn.extend( {
// i.e. return false for nodes (but not parents) that are hidden // i.e. return false for nodes (but not parents) that are hidden
// by a filter // by a filter
if (hasFilter && !this.match && !this.subMatchCount) { if (hasFilter && !this.match && !this.subMatchCount) {
this.debug( // this.debug( "isVisible: HIDDEN (" + hasFilter + ", " + this.match + ", " + this.match + ")" );
"isVisible: HIDDEN (" +
hasFilter +
", " +
this.match +
", " +
this.match +
")"
);
return false; return false;
} }
@ -2963,7 +2955,7 @@ var uniqueId = $.fn.extend( {
n = parents[i]; n = parents[i];
if (!n.expanded) { if (!n.expanded) {
this.debug("isVisible: HIDDEN (parent collapsed)"); // this.debug("isVisible: HIDDEN (parent collapsed)");
return false; return false;
} }
// if (hasFilter && !n.match && !n.subMatchCount) { // if (hasFilter && !n.match && !n.subMatchCount) {
@ -2971,7 +2963,7 @@ var uniqueId = $.fn.extend( {
// return false; // return false;
// } // }
} }
this.debug("isVisible: VISIBLE"); // this.debug("isVisible: VISIBLE");
return true; return true;
}, },
/** Deprecated. /** Deprecated.
@ -4788,6 +4780,10 @@ var uniqueId = $.fn.extend( {
}, },
/** /**
* Return an array of selected nodes. * Return an array of selected nodes.
*
* Note: you cannot send this result via Ajax directly. Instead the
* node object need to be converted to plain objects, for example
* by using `$.map()` and `node.toDict()`.
* @param {boolean} [stopOnParents=false] only return the topmost selected * @param {boolean} [stopOnParents=false] only return the topmost selected
* node (useful with selectMode 3) * node (useful with selectMode 3)
* @returns {FancytreeNode[]} * @returns {FancytreeNode[]}
@ -6714,7 +6710,13 @@ var uniqueId = $.fn.extend( {
dfd.done(function() { dfd.done(function() {
var lastChild = node.getLastChild(); var lastChild = node.getLastChild();
if (flag && opts.autoScroll && !noAnimation && lastChild) { if (
flag &&
opts.autoScroll &&
!noAnimation &&
lastChild &&
tree._enableUpdate
) {
// Scroll down to last child, but keep current node visible // Scroll down to last child, but keep current node visible
lastChild lastChild
.scrollIntoView(true, { topNode: node }) .scrollIntoView(true, { topNode: node })
@ -6773,9 +6775,7 @@ var uniqueId = $.fn.extend( {
$(node.li).addClass(cn.animating); // #717 $(node.li).addClass(cn.animating); // #717
if ($.isFunction($(node.ul)[effect.effect])) { if ($.isFunction($(node.ul)[effect.effect])) {
tree.debug( // tree.debug( "use jquery." + effect.effect + " method" );
"use jquery." + effect.effect + " method"
);
$(node.ul)[effect.effect]({ $(node.ul)[effect.effect]({
duration: effect.duration, duration: effect.duration,
always: function() { always: function() {
@ -7263,16 +7263,30 @@ var uniqueId = $.fn.extend( {
type = $container.data("type") || "html"; type = $container.data("type") || "html";
switch (type) { switch (type) {
case "html": case "html":
$ul = $container.find(">ul").first(); // There should be an embedded `<ul>` with initial nodes,
$ul.addClass( // but another `<ul class='fancytree-container'>` is appended
"ui-fancytree-source fancytree-helper-hidden" // to the tree's <div> on startup anyway.
); $ul = $container
source = $.ui.fancytree.parseHtml($ul); .find(">ul")
// allow to init tree.data.foo from <ul data-foo=''> .not(".fancytree-container")
this.data = $.extend( .first();
this.data,
_getElementDataAsDict($ul) if ($ul.length) {
); $ul.addClass(
"ui-fancytree-source fancytree-helper-hidden"
);
source = $.ui.fancytree.parseHtml($ul);
// allow to init tree.data.foo from <ul data-foo=''>
this.data = $.extend(
this.data,
_getElementDataAsDict($ul)
);
} else {
FT.warn(
"No `source` option was passed and container does not contain `<ul>`: assuming `source: []`."
);
source = [];
}
break; break;
case "json": case "json":
source = $.parseJSON($container.text()); source = $.parseJSON($container.text());
@ -7312,8 +7326,9 @@ var uniqueId = $.fn.extend( {
$.error("Not implemented"); $.error("Not implemented");
} }
// TODO: might be useful? Let's wait for a use case... // preInit is fired when the widget markup is created, but nodes
// tree._triggerTreeEvent("beforeInitLoad", null); // not yet loaded
tree._triggerTreeEvent("preInit", null);
// Trigger fancytreeinit after nodes have been loaded // Trigger fancytreeinit after nodes have been loaded
dfd = this.nodeLoadChildren(rootCtx, source) dfd = this.nodeLoadChildren(rootCtx, source)
@ -7927,7 +7942,7 @@ var uniqueId = $.fn.extend( {
/** @lends Fancytree_Static# */ /** @lends Fancytree_Static# */
{ {
/** @type {string} */ /** @type {string} */
version: "2.32.0", // Set to semver by 'grunt release' version: "2.33.0", // Set to semver by 'grunt release'
/** @type {string} */ /** @type {string} */
buildType: "production", // Set to 'production' by 'grunt build' buildType: "production", // Set to 'production' by 'grunt build'
/** @type {int} */ /** @type {int} */
@ -8550,8 +8565,8 @@ var uniqueId = $.fn.extend( {
* Released under the MIT license * Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo * https://github.com/mar10/fancytree/wiki/LicenseInfo
* *
* @version 2.32.0 * @version 2.33.0
* @date 2019-09-10T07:42:12Z * @date 2019-10-29T08:00:07Z
*/ */
// To keep the global namespace clean, we wrap everything in a closure. // To keep the global namespace clean, we wrap everything in a closure.
@ -8670,7 +8685,7 @@ var uniqueId = $.fn.extend( {
// Every extension must be registered by a unique name. // Every extension must be registered by a unique name.
name: "childcounter", name: "childcounter",
// Version information should be compliant with [semver](http://semver.org) // Version information should be compliant with [semver](http://semver.org)
version: "2.32.0", version: "2.33.0",
// Extension specific options and their defaults. // Extension specific options and their defaults.
// This options will be available as `tree.options.childcounter.hideExpanded` // This options will be available as `tree.options.childcounter.hideExpanded`
@ -8781,8 +8796,8 @@ var uniqueId = $.fn.extend( {
* Released under the MIT license * Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo * https://github.com/mar10/fancytree/wiki/LicenseInfo
* *
* @version 2.32.0 * @version 2.33.0
* @date 2019-09-10T07:42:12Z * @date 2019-10-29T08:00:07Z
*/ */
(function(factory) { (function(factory) {
@ -9140,7 +9155,7 @@ var uniqueId = $.fn.extend( {
*/ */
$.ui.fancytree.registerExtension({ $.ui.fancytree.registerExtension({
name: "clones", name: "clones",
version: "2.32.0", version: "2.33.0",
// Default options for this extension. // Default options for this extension.
options: { options: {
highlightActiveClones: true, // set 'fancytree-active-clone' on active clones and all peers highlightActiveClones: true, // set 'fancytree-active-clone' on active clones and all peers
@ -9302,8 +9317,8 @@ var uniqueId = $.fn.extend( {
* Released under the MIT license * Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo * https://github.com/mar10/fancytree/wiki/LicenseInfo
* *
* @version 2.32.0 * @version 2.33.0
* @date 2019-09-10T07:42:12Z * @date 2019-10-29T08:00:07Z
*/ */
/* /*
@ -10123,6 +10138,7 @@ var uniqueId = $.fn.extend( {
// ": dropEffect: " + // ": dropEffect: " +
// dataTransfer.dropEffect // dataTransfer.dropEffect
// ); // );
prepareDropEffectCallback(event, data);
LAST_HIT_MODE = handleDragOver(event, data); LAST_HIT_MODE = handleDragOver(event, data);
// The flag controls the preventDefault() below: // The flag controls the preventDefault() below:
@ -10306,7 +10322,7 @@ var uniqueId = $.fn.extend( {
$.ui.fancytree.registerExtension({ $.ui.fancytree.registerExtension({
name: "dnd5", name: "dnd5",
version: "2.32.0", version: "2.33.0",
// Default options for this extension. // Default options for this extension.
options: { options: {
autoExpandMS: 1500, // Expand nodes after n milliseconds of hovering autoExpandMS: 1500, // Expand nodes after n milliseconds of hovering
@ -10439,8 +10455,8 @@ var uniqueId = $.fn.extend( {
* Released under the MIT license * Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo * https://github.com/mar10/fancytree/wiki/LicenseInfo
* *
* @version 2.32.0 * @version 2.33.0
* @date 2019-09-10T07:42:12Z * @date 2019-10-29T08:00:07Z
*/ */
(function(factory) { (function(factory) {
@ -10732,7 +10748,7 @@ var uniqueId = $.fn.extend( {
*/ */
$.ui.fancytree.registerExtension({ $.ui.fancytree.registerExtension({
name: "edit", name: "edit",
version: "2.32.0", version: "2.33.0",
// Default options for this extension. // Default options for this extension.
options: { options: {
adjustWidthOfs: 4, // null: don't adjust input size to content adjustWidthOfs: 4, // null: don't adjust input size to content
@ -10843,8 +10859,8 @@ var uniqueId = $.fn.extend( {
* Released under the MIT license * Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo * https://github.com/mar10/fancytree/wiki/LicenseInfo
* *
* @version 2.32.0 * @version 2.33.0
* @date 2019-09-10T07:42:12Z * @date 2019-10-29T08:00:07Z
*/ */
(function(factory) { (function(factory) {
@ -11008,7 +11024,9 @@ var uniqueId = $.fn.extend( {
count++; count++;
node.match = true; node.match = true;
node.visitParents(function(p) { node.visitParents(function(p) {
p.subMatchCount += 1; if (p !== node) {
p.subMatchCount += 1;
}
// Expand match (unless this is no real match, but only a node in a matched branch) // Expand match (unless this is no real match, but only a node in a matched branch)
if (opts.autoExpand && !matchedByBranch && !p.expanded) { if (opts.autoExpand && !matchedByBranch && !p.expanded) {
p.setExpanded(true, { p.setExpanded(true, {
@ -11180,7 +11198,7 @@ var uniqueId = $.fn.extend( {
*/ */
$.ui.fancytree.registerExtension({ $.ui.fancytree.registerExtension({
name: "filter", name: "filter",
version: "2.32.0", version: "2.33.0",
// Default options for this extension. // Default options for this extension.
options: { options: {
autoApply: true, // Re-apply last filter if lazy data is loaded autoApply: true, // Re-apply last filter if lazy data is loaded
@ -11300,8 +11318,8 @@ var uniqueId = $.fn.extend( {
* Released under the MIT license * Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo * https://github.com/mar10/fancytree/wiki/LicenseInfo
* *
* @version 2.32.0 * @version 2.33.0
* @date 2019-09-10T07:42:12Z * @date 2019-10-29T08:00:07Z
*/ */
(function(factory) { (function(factory) {
@ -11484,7 +11502,7 @@ var uniqueId = $.fn.extend( {
$.ui.fancytree.registerExtension({ $.ui.fancytree.registerExtension({
name: "glyph", name: "glyph",
version: "2.32.0", version: "2.33.0",
// Default options for this extension. // Default options for this extension.
options: { options: {
preset: null, // 'awesome3', 'awesome4', 'bootstrap3', 'material' preset: null, // 'awesome3', 'awesome4', 'bootstrap3', 'material'
@ -11638,8 +11656,8 @@ var uniqueId = $.fn.extend( {
* Released under the MIT license * Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo * https://github.com/mar10/fancytree/wiki/LicenseInfo
* *
* @version 2.32.0 * @version 2.33.0
* @date 2019-09-10T07:42:12Z * @date 2019-10-29T08:00:07Z
*/ */
(function(factory) { (function(factory) {
@ -11756,7 +11774,7 @@ var uniqueId = $.fn.extend( {
*/ */
$.ui.fancytree.registerExtension({ $.ui.fancytree.registerExtension({
name: "gridnav", name: "gridnav",
version: "2.32.0", version: "2.33.0",
// Default options for this extension. // Default options for this extension.
options: { options: {
autofocusInput: false, // Focus first embedded input if node gets activated autofocusInput: false, // Focus first embedded input if node gets activated
@ -11863,8 +11881,8 @@ var uniqueId = $.fn.extend( {
* Released under the MIT license * Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo * https://github.com/mar10/fancytree/wiki/LicenseInfo
* *
* @version 2.32.0 * @version 2.33.0
* @date 2019-09-10T07:42:12Z * @date 2019-10-29T08:00:07Z
*/ */
(function(factory) { (function(factory) {
@ -11893,7 +11911,7 @@ var uniqueId = $.fn.extend( {
*/ */
$.ui.fancytree.registerExtension({ $.ui.fancytree.registerExtension({
name: "multi", name: "multi",
version: "2.32.0", version: "2.33.0",
// Default options for this extension. // Default options for this extension.
options: { options: {
allowNoSelect: false, // allowNoSelect: false, //
@ -11995,8 +12013,8 @@ var uniqueId = $.fn.extend( {
* Released under the MIT license * Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo * https://github.com/mar10/fancytree/wiki/LicenseInfo
* *
* @version 2.32.0 * @version 2.33.0
* @date 2019-09-10T07:42:12Z * @date 2019-10-29T08:00:07Z
*/ */
(function(factory) { (function(factory) {
@ -12196,7 +12214,7 @@ var uniqueId = $.fn.extend( {
*/ */
$.ui.fancytree.registerExtension({ $.ui.fancytree.registerExtension({
name: "persist", name: "persist",
version: "2.32.0", version: "2.33.0",
// Default options for this extension. // Default options for this extension.
options: { options: {
cookieDelimiter: "~", cookieDelimiter: "~",
@ -12489,8 +12507,8 @@ var uniqueId = $.fn.extend( {
* Released under the MIT license * Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo * https://github.com/mar10/fancytree/wiki/LicenseInfo
* *
* @version 2.32.0 * @version 2.33.0
* @date 2019-09-10T07:42:12Z * @date 2019-10-29T08:00:07Z
*/ */
(function(factory) { (function(factory) {
@ -12573,7 +12591,7 @@ var uniqueId = $.fn.extend( {
$.ui.fancytree.registerExtension({ $.ui.fancytree.registerExtension({
name: "table", name: "table",
version: "2.32.0", version: "2.33.0",
// Default options for this extension. // Default options for this extension.
options: { options: {
checkboxColumnIdx: null, // render the checkboxes into the this column index (default: nodeColumnIdx) checkboxColumnIdx: null, // render the checkboxes into the this column index (default: nodeColumnIdx)
@ -13039,8 +13057,8 @@ var uniqueId = $.fn.extend( {
* Released under the MIT license * Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo * https://github.com/mar10/fancytree/wiki/LicenseInfo
* *
* @version 2.32.0 * @version 2.33.0
* @date 2019-09-10T07:42:12Z * @date 2019-10-29T08:00:07Z
*/ */
(function(factory) { (function(factory) {
@ -13063,7 +13081,7 @@ var uniqueId = $.fn.extend( {
*/ */
$.ui.fancytree.registerExtension({ $.ui.fancytree.registerExtension({
name: "themeroller", name: "themeroller",
version: "2.32.0", version: "2.33.0",
// Default options for this extension. // Default options for this extension.
options: { options: {
activeClass: "ui-state-active", // Class added to active node activeClass: "ui-state-active", // Class added to active node
@ -13159,8 +13177,8 @@ var uniqueId = $.fn.extend( {
* Released under the MIT license * Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo * https://github.com/mar10/fancytree/wiki/LicenseInfo
* *
* @version 2.32.0 * @version 2.33.0
* @date 2019-09-10T07:42:12Z * @date 2019-10-29T08:00:07Z
*/ */
(function(factory) { (function(factory) {
@ -13290,7 +13308,7 @@ var uniqueId = $.fn.extend( {
*/ */
$.ui.fancytree.registerExtension({ $.ui.fancytree.registerExtension({
name: "wide", name: "wide",
version: "2.32.0", version: "2.33.0",
// Default options for this extension. // Default options for this extension.
options: { options: {
iconWidth: null, // Adjust this if @fancy-icon-width != "16px" iconWidth: null, // Adjust this if @fancy-icon-width != "16px"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -13,8 +13,8 @@
* Released under the MIT license * Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo * https://github.com/mar10/fancytree/wiki/LicenseInfo
* *
* @version 2.32.0 * @version 2.33.0
* @date 2019-09-10T07:42:12Z * @date 2019-10-29T08:00:07Z
******************************************************************************/ ******************************************************************************/
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
* Helpers * Helpers
@ -121,7 +121,6 @@ span.fancytree-drag-helper-img,
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: left;
background-image: url("../skin-win8/icons.gif"); background-image: url("../skin-win8/icons.gif");
background-position: 0px 0px; background-position: 0px 0px;
} }

File diff suppressed because one or more lines are too long