/*! * jquery.fancytree.columnview.js * * Render tree like a Mac Finder's column view. * (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/) * * Copyright (c) 2014, Martin Wendt (http://wwWendt.de) * * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * * @version 2.0.0-11 * @date 2014-04-27T22:28 */ ;(function($, window, document, undefined) { "use strict"; // prevent duplicate loading // if ( $.ui.fancytree && $.ui.fancytree.version ) { // $.ui.fancytree.warn("Fancytree: duplicate include"); // return; // } /******************************************************************************* * Private functions and variables */ /* function _assert(cond, msg){ msg = msg || ""; if(!cond){ $.error("Assertion failed " + msg); } } */ /******************************************************************************* * Private functions and variables */ $.ui.fancytree.registerExtension({ name: "columnview", version: "0.0.1", // Default options for this extension. options: { }, // Overide virtual methods for this extension. // `this` : is this extension object // `this._base` : the Fancytree instance // `this._super`: the virtual function that was overriden (member of prev. extension or Fancytree) treeInit: function(ctx){ var $tdFirst, $ul, tree = ctx.tree, $table = tree.widget.element; tree.tr = $("tbody tr", $table)[0]; tree.columnCount = $(">td", tree.tr).length; // Perform default behavior this._super(ctx); // Standard Fancytree created a root