Skip to content

Commit

Permalink
Bumping version to 2.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mar10 committed Jun 26, 2015
1 parent cd4d6a1 commit 0ca9e9b
Show file tree
Hide file tree
Showing 85 changed files with 352 additions and 251 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jquery.fancytree",
"description": "Fancytree is a JavaScript tree view plugin for jQuery with support for persistence, keyboard, checkboxes, drag'n'drop, and lazy loading.",
"version": "2.9.1-0",
"version": "2.10.0",
"main": [
"dist/jquery.fancytree-all.min.js"
],
Expand Down
134 changes: 75 additions & 59 deletions dist/jquery.fancytree-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo
*
* @version 2.9.0
* @date 2015-04-19T13:41
* @version 2.10.0
* @date 2015-06-26T22:37
*/

/** Core Fancytree module.
Expand Down Expand Up @@ -968,7 +968,7 @@ FancytreeNode.prototype = /** @lends FancytreeNode# */{
isLoading: function() {
return !!this._isLoading;
},
/**
/*
* @deprecated since v2.4.0: Use isRootNode() instead
*/
isRoot: function() {
Expand Down Expand Up @@ -1369,7 +1369,7 @@ FancytreeNode.prototype = /** @lends FancytreeNode# */{
render: function(force, deep) {
return this.tree._callHook("nodeRender", this, force, deep);
},
/** Create HTML markup for the node's outer <span> (expander, checkbox, icon, and title).
/** Create HTML markup for the node's outer &lt;span> (expander, checkbox, icon, and title).
* @see Fancytree_Hooks#nodeRenderTitle
*/
renderTitle: function() {
Expand Down Expand Up @@ -2579,7 +2579,7 @@ $.extend(Fancytree.prototype,
tree.nodeSetActive(ctx, true);
}
break;
case "enter":
case "return":
tree.nodeSetActive(ctx, true);
break;
case "backspace":
Expand Down Expand Up @@ -2843,6 +2843,7 @@ $.extend(Fancytree.prototype,
} else{
node.children = null;
}
node.expanded = false; // #449
this.nodeRenderStatus(ctx);
},
/**Remove HTML markup for ctx.node and all its descendents.
Expand Down Expand Up @@ -2870,20 +2871,20 @@ $.extend(Fancytree.prototype,
*
* Note: if a node was created/removed, nodeRender() must be called for the
* parent.
* <code>
* <li id='KEY' ftnode=NODE>
* <span class='fancytree-node fancytree-expanded fancytree-has-children fancytree-lastsib fancytree-exp-el fancytree-ico-e'>
* <span class="fancytree-expander"></span>
* <span class="fancytree-checkbox"></span> // only present in checkbox mode
* <span class="fancytree-icon"></span>
* <a href="#" class="fancytree-title"> Node 1 </a>
* </span>
* <ul> // only present if node has children
* <li id='KEY' ftnode=NODE> child1 ... </li>
* <li id='KEY' ftnode=NODE> child2 ... </li>
* </ul>
* </li>
* </code>
* &lt;code>
* &lt;li id='KEY' ftnode=NODE>
* &lt;span class='fancytree-node fancytree-expanded fancytree-has-children fancytree-lastsib fancytree-exp-el fancytree-ico-e'>
* &lt;span class="fancytree-expander">&lt;/span>
* &lt;span class="fancytree-checkbox">&lt;/span> // only present in checkbox mode
* &lt;span class="fancytree-icon">&lt;/span>
* &lt;a href="#" class="fancytree-title"> Node 1 &lt;/a>
* &lt;/span>
* &lt;ul> // only present if node has children
* &lt;li id='KEY' ftnode=NODE> child1 ... &lt;/li>
* &lt;li id='KEY' ftnode=NODE> child2 ... &lt;/li>
* &lt;/ul>
* &lt;/li>
* &lt;/code>
*
* @param {EventData} ctx
* @param {boolean} [force=false] re-render, even if html markup was already created
Expand Down Expand Up @@ -3035,7 +3036,8 @@ $.extend(Fancytree.prototype,
}
}
},
/** Create HTML for the node's outer <span> (expander, checkbox, icon, and title).
/** Create HTML inside the node's outer &lt;span> (i.e. expander, checkbox,
* icon, and title).
*
* nodeRenderStatus() is implied.
* @param {EventData} ctx
Expand Down Expand Up @@ -3366,9 +3368,10 @@ $.extend(Fancytree.prototype,
}
// Trigger expand/collapse after expanding
dfd.done(function(){
if( flag && opts.autoScroll && !noAnimation ) {
var lastChild = node.getLastChild();
if( flag && opts.autoScroll && !noAnimation && lastChild ) {
// Scroll down to last child, but keep current node visible
node.getLastChild().scrollIntoView(true, {topNode: node}).always(function(){
lastChild.scrollIntoView(true, {topNode: node}).always(function(){
if( !noEvents ) {
ctx.tree._triggerNodeEvent(flag ? "expand" : "collapse", ctx);
}
Expand Down Expand Up @@ -3662,6 +3665,8 @@ $.extend(Fancytree.prototype,
* @param {EventData} ctx
*/
treeDestroy: function(ctx) {
this.$div.find(">ul.fancytree-container").remove();
this.$source && this.$source.removeClass("ui-helper-hidden");
},
/** Widget was (re-)initialized.
* @param {EventData} ctx
Expand Down Expand Up @@ -3921,9 +3926,6 @@ $.widget("ui.fancytree",
destroy: function() {
this._unbind();
this.tree._callHook("treeDestroy", this.tree);
// this.element.removeClass("ui-widget ui-widget-content ui-corner-all");
this.tree.$div.find(">ul.fancytree-container").remove();
this.$source && this.$source.removeClass("ui-helper-hidden");
// In jQuery UI 1.8, you must invoke the destroy method from the base widget
$.Widget.prototype.destroy.call(this);
// TODO: delete tree and nodes to make garbage collect easier?
Expand Down Expand Up @@ -4075,7 +4077,7 @@ $.extend($.ui.fancytree,
/** @lends Fancytree_Static# */
{
/** @type {string} */
version: "2.9.0", // Set to semver by 'grunt release'
version: "2.10.0", // Set to semver by 'grunt release'
/** @type {string} */
buildType: "production", // Set to 'production' by 'grunt build'
/** @type {int} */
Expand Down Expand Up @@ -4437,8 +4439,8 @@ $.extend($.ui.fancytree,
* Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo
*
* @version 2.9.0
* @date 2015-04-19T13:41
* @version 2.10.0
* @date 2015-06-26T22:37
*/

// To keep the global namespace clean, we wrap everything in a closure
Expand Down Expand Up @@ -4613,8 +4615,8 @@ $.ui.fancytree.registerExtension({
* Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo
*
* @version 2.9.0
* @date 2015-04-19T13:41
* @version 2.10.0
* @date 2015-06-26T22:37
*/

;(function($, window, document, undefined) {
Expand Down Expand Up @@ -5065,8 +5067,8 @@ $.ui.fancytree.registerExtension({
* Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo
*
* @version 2.9.0
* @date 2015-04-19T13:41
* @version 2.10.0
* @date 2015-06-26T22:37
*/

;(function($, window, document, undefined) {
Expand Down Expand Up @@ -5622,8 +5624,8 @@ $.ui.fancytree.registerExtension({
* Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo
*
* @version 2.9.0
* @date 2015-04-19T13:41
* @version 2.10.0
* @date 2015-06-26T22:37
*/

;(function($, window, document, undefined) {
Expand Down Expand Up @@ -5930,8 +5932,8 @@ $.ui.fancytree.registerExtension({
* Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo
*
* @version 2.9.0
* @date 2015-04-19T13:41
* @version 2.10.0
* @date 2015-06-26T22:37
*/

;(function($, window, document, undefined) {
Expand Down Expand Up @@ -6039,7 +6041,7 @@ $.ui.fancytree._FancytreeClass.prototype.applyFilter = function(filter){
* @requires jquery.fancytree.filter.js
*/
$.ui.fancytree._FancytreeClass.prototype.filterBranches = function(filter, opts){
return this._applyFilterImpl(filter, true, null);
return this._applyFilterImpl(filter, true, opts);
};


Expand Down Expand Up @@ -6123,8 +6125,8 @@ $.ui.fancytree.registerExtension({
* Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo
*
* @version 2.9.0
* @date 2015-04-19T13:41
* @version 2.10.0
* @date 2015-06-26T22:37
*/

;(function($, window, document, undefined) {
Expand Down Expand Up @@ -6256,8 +6258,8 @@ $.ui.fancytree.registerExtension({
* Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo
*
* @version 2.9.0
* @date 2015-04-19T13:41
* @version 2.10.0
* @date 2015-06-26T22:37
*/

;(function($, window, document, undefined) {
Expand Down Expand Up @@ -6451,31 +6453,42 @@ $.ui.fancytree.registerExtension({
* Persist tree status in cookiesRemove or highlight tree nodes, based on a filter.
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
*
* @depends: jquery.cookie.js
* @depends: js-cookie or jquery-cookie
*
* Copyright (c) 2008-2015, Martin Wendt (http://wwWendt.de)
*
* Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo
*
* @version 2.9.0
* @date 2015-04-19T13:41
* @version 2.10.0
* @date 2015-06-26T22:37
*/

;(function($, window, document, undefined) {

"use strict";

/* global Cookies:false */

/*******************************************************************************
* Private functions and variables
*/
var _assert = $.ui.fancytree.assert,
var cookieGetter, cookieRemover, cookieSetter,
_assert = $.ui.fancytree.assert,
ACTIVE = "active",
EXPANDED = "expanded",
FOCUS = "focus",
SELECTED = "selected";

if( typeof Cookies === "function" ) {
// Assume https://github.com/js-cookie/js-cookie
cookieSetter = Cookies.set;
cookieGetter = Cookies.get;
cookieRemover = Cookies.remove;
} else {
// Fall back to https://github.com/carhartl/jquery-cookie
cookieSetter = cookieGetter = $.cookie;
cookieRemover = $.removeCookie;
}

/* Recursively load lazy nodes
* @param {string} mode 'load', 'expand', false
Expand Down Expand Up @@ -6610,18 +6623,18 @@ $.ui.fancytree.registerExtension({
var ls = this._local.localStorage; // null, sessionStorage, or localStorage

if( value === undefined ) {
return ls ? ls.getItem(key) : $.cookie(key);
return ls ? ls.getItem(key) : cookieGetter(key);
} else if ( value === null ) {
if( ls ) {
ls.removeItem(key);
} else {
$.removeCookie(key);
cookieRemover(key);
}
} else {
if( ls ) {
ls.setItem(key, value);
} else {
$.cookie(key, value, this.options.persist.cookie);
cookieSetter(key, value, this.options.persist.cookie);
}
}
},
Expand Down Expand Up @@ -6654,7 +6667,7 @@ $.ui.fancytree.registerExtension({
instOpts = this.options.persist;

// For 'auto' or 'cookie' mode, the cookie plugin must be available
_assert(instOpts.store === "localStore" || $.cookie, "Missing required plugin for 'persist' extension: jquery.cookie.js");
_assert(instOpts.store === "localStore" || cookieGetter, "Missing required plugin for 'persist' extension: js.cookie.js or jquery.cookie.js");

local.cookiePrefix = instOpts.cookiePrefix || ("fancytree-" + tree._id + "-");
local.storeActive = instOpts.types.indexOf(ACTIVE) >= 0;
Expand Down Expand Up @@ -6822,8 +6835,8 @@ $.ui.fancytree.registerExtension({
* Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo
*
* @version 2.9.0
* @date 2015-04-19T13:41
* @version 2.10.0
* @date 2015-06-26T22:37
*/

;(function($, window, document, undefined) {
Expand Down Expand Up @@ -7160,6 +7173,10 @@ $.ui.fancytree.registerExtension({
treeClear: function(ctx) {
this.nodeRemoveChildMarkup(this._makeHookContext(this.rootNode));
return this._superApply(arguments);
},
treeDestroy: function(ctx) {
this.$container.find("tbody").empty();
this.$source && this.$source.removeClass("ui-helper-hidden");
}
/*,
treeSetFocus: function(ctx, flag) {
Expand All @@ -7183,8 +7200,8 @@ $.ui.fancytree.registerExtension({
* Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo
*
* @version 2.9.0
* @date 2015-04-19T13:41
* @version 2.10.0
* @date 2015-06-26T22:37
*/

;(function($, window, document, undefined) {
Expand Down Expand Up @@ -7221,7 +7238,7 @@ $.ui.fancytree.registerExtension({
var node = $.ui.fancytree.getNode(event.target),
flag = (event.type === "mouseenter");
node.debug("hover: " + flag);
$(node.span).toggleClass("ui-state-hover ui-corner-all", flag);
$(node.tr ? node.tr : node.span).toggleClass("ui-state-hover ui-corner-all", flag);
});
},
treeDestroy: function(ctx){
Expand All @@ -7230,7 +7247,7 @@ $.ui.fancytree.registerExtension({
},
nodeRenderStatus: function(ctx){
var node = ctx.node,
$el = $(node.span);
$el = $(node.tr ? node.tr : node.span);
this._superApply(arguments);
/*
.ui-state-highlight: Class to be applied to highlighted or selected elements. Applies "highlight" container styles to an element and its child text, links, and icons.
Expand All @@ -7245,7 +7262,6 @@ $.ui.fancytree.registerExtension({
$el.toggleClass("ui-state-active", node.isActive());
$el.toggleClass("ui-state-focus", node.hasFocus());
$el.toggleClass("ui-state-highlight", node.isSelected());
// node.debug("ext-themeroller.nodeRenderStatus: ", node.span.className);
}
});
}(jQuery, window, document));
Expand All @@ -7260,8 +7276,8 @@ $.ui.fancytree.registerExtension({
* Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo
*
* @version 2.9.0
* @date 2015-04-19T13:41
* @version 2.10.0
* @date 2015-06-26T22:37
*/

;(function($, window, document, undefined) {
Expand Down
14 changes: 7 additions & 7 deletions dist/jquery.fancytree-all.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 0ca9e9b

Please sign in to comment.