Lines Matching defs:ctx

2761 			var ctx, tree;
2767 ctx = obj;
2771 ctx = {
2781 ctx = {
2792 $.extend(ctx, extra);
2794 return ctx;
2796 /* Trigger a hook function: funcName(ctx, [...]).
2804 var ctx = this._makeHookContext(contextObject),
2810 args.unshift(ctx);
2811 // this.debug("_hook", funcName, ctx.node && ctx.node.toString() || ctx.tree.toString(), args);
3593 opts.callback = function (ctx, node, status) {
3595 callback.call(ctx, node, status);
3597 dfd.notifyWith(ctx, [{ node: node, status: status }]);
3861 /* _trigger a widget event with additional node ctx.
3865 // this.debug("_trigger(" + type + "): '" + ctx.node.title + "'", ctx);
3866 var ctx = this._makeHookContext(node, originalEvent, extra),
3867 res = this.widget._trigger(type, originalEvent, ctx);
3868 if (res !== false && ctx.result !== undefined) {
3869 return ctx.result;
3875 // this.debug("_trigger(" + type + ")", ctx);
3876 var ctx = this._makeHookContext(this, originalEvent, extra),
3877 res = this.widget._trigger(type, originalEvent, ctx);
3879 if (res !== false && ctx.result !== undefined) {
3880 return ctx.result;
4052 * @param {EventData} ctx
4054 nodeClick: function (ctx) {
4057 // event = ctx.originalEvent,
4058 targetType = ctx.targetType,
4059 node = ctx.node;
4061 // this.debug("ftnode.onClick(" + event.type + "): ftnode:" + this + ", button:" + event.button + ", which: " + event.which, ctx);
4076 this._callHook("nodeToggleExpanded", ctx);
4079 this._callHook("nodeToggleSelected", ctx);
4080 if (ctx.options.focusOnSelect) {
4082 this._callHook("nodeSetFocus", ctx, true);
4089 switch (ctx.options.clickFolderMode) {
4102 this.nodeSetFocus(ctx);
4103 this._callHook("nodeSetActive", ctx, true);
4107 // this._callHook("nodeSetFocus", ctx);
4109 // this._callHook("nodeSetExpanded", ctx, true);
4110 this._callHook("nodeToggleExpanded", ctx);
4121 * @param {EventData} ctx
4124 nodeCollapseSiblings: function (ctx, callOpts) {
4129 node = ctx.node;
4146 * @param {EventData} ctx
4148 nodeDblclick: function (ctx) {
4151 ctx.targetType === "title" &&
4152 ctx.options.clickFolderMode === 4
4154 // this.nodeSetFocus(ctx);
4155 // this._callHook("nodeSetActive", ctx, true);
4156 this._callHook("nodeToggleExpanded", ctx);
4159 if (ctx.targetType === "title") {
4160 ctx.originalEvent.preventDefault();
4166 * @param {EventData} ctx
4168 nodeKeydown: function (ctx) {
4174 event = ctx.originalEvent,
4175 node = ctx.node,
4176 tree = ctx.tree,
4177 opts = ctx.options,
4205 node = ctx.node = this.focusNode;
4236 tree.nodeSetExpanded(ctx, true);
4239 tree.nodeSetExpanded(ctx, false);
4243 tree._triggerNodeEvent("clickPaging", ctx, event);
4248 tree.nodeToggleSelected(ctx);
4250 tree.nodeSetActive(ctx, true);
4254 tree.nodeSetActive(ctx, true);
4274 // nodeKeypress: function(ctx) {
4275 // var event = ctx.originalEvent;
4279 // nodeLazyLoad: function(ctx) {
4280 // var node = ctx.node;
4285 * @param {EventData} ctx
4290 nodeLoadChildren: function (ctx, source) {
4296 tree = ctx.tree,
4297 node = ctx.node,
4304 source = source.call(tree, { type: "source" }, ctx);
4316 ajax = $.extend({}, ctx.options.ajax, source);
4379 tree.nodeSetStatus(ctx, "loading");
4424 if (ctx.options.postProcess) {
4426 // - modify `ctx.response` in-place (and leave `ctx.result` undefined)
4428 // - return a replacement in `ctx.result`
4434 ctx,
4435 ctx.originalEvent,
4473 // Use `ctx.result` if valid
4480 ctx.options.enableAspx
4484 if (ctx.options.enableAspx === 42) {
4516 tree.nodeSetStatus(ctx, "ok");
4556 ctx
4620 ctx,
4637 nodeLoadKeyPath: function (ctx, keyPathList) {
4642 * Remove a single direct child of ctx.node.
4643 * @param {EventData} ctx
4644 * @param {FancytreeNode} childNode dircect child of ctx.node
4646 nodeRemoveChild: function (ctx, childNode) {
4648 node = ctx.node,
4649 // opts = ctx.options,
4650 subCtx = $.extend({}, ctx, { node: childNode }),
4657 return this.nodeRemoveChildren(ctx);
4688 /**Remove HTML markup for all descendents of ctx.node.
4689 * @param {EventData} ctx
4691 nodeRemoveChildMarkup: function (ctx) {
4692 var node = ctx.node;
4708 /**Remove all descendants of ctx.node.
4709 * @param {EventData} ctx
4711 nodeRemoveChildren: function (ctx) {
4713 tree = ctx.tree,
4714 node = ctx.node,
4716 // opts = ctx.options;
4729 this.nodeRemoveChildMarkup(ctx);
4732 // subCtx = $.extend({}, ctx);
4747 this.nodeRenderStatus(ctx);
4749 /**Remove HTML markup for ctx.node and all its descendents.
4750 * @param {EventData} ctx
4752 nodeRemoveMarkup: function (ctx) {
4753 var node = ctx.node;
4760 this.nodeRemoveChildMarkup(ctx);
4787 * @param {EventData} ctx
4792 nodeRender: function (ctx, force, deep, collapsed, _recursive) {
4809 node = ctx.node,
4810 tree = ctx.tree,
4811 opts = ctx.options,
4851 this.nodeRemoveMarkup(ctx);
4856 // this.nodeRenderTitle(ctx);
4857 this.nodeRenderStatus(ctx);
4875 this.nodeRenderTitle(ctx);
4882 ctx
4888 opts.renderNode.call(tree, { type: "renderNode" }, ctx);
4917 subCtx = $.extend({}, ctx, { node: children[i] });
4957 this.nodeRemoveChildMarkup(ctx);
4962 // this.nodeRenderStatus(ctx);
4977 * @param {EventData} ctx
4980 nodeRenderTitle: function (ctx, title) {
4990 node = ctx.node,
4991 tree = ctx.tree,
4992 opts = ctx.options,
5148 ctx
5181 this.nodeRenderStatus(ctx);
5183 ctx.$title = $(">span.fancytree-title", node.span);
5188 ctx
5193 * @param {EventData} ctx
5195 nodeRenderStatus: function (ctx) {
5198 node = ctx.node,
5199 tree = ctx.tree,
5200 opts = ctx.options,
5314 * @param {EventData} ctx
5319 nodeSetActive: function (ctx, flag, callOpts) {
5323 node = ctx.node,
5324 tree = ctx.tree,
5325 opts = ctx.options,
5342 ctx.originalEvent &&
5343 $(ctx.originalEvent.target).is("a,:checkbox")
5354 ctx.originalEvent
5366 subCtx = $.extend({}, ctx, { node: tree.activeNode });
5381 tree.nodeRenderStatus(ctx);
5383 tree.nodeSetFocus(ctx);
5389 ctx.originalEvent
5398 this.nodeRenderStatus(ctx);
5400 ctx.tree._triggerNodeEvent(
5403 ctx.originalEvent
5411 * @param {EventData} ctx
5417 nodeSetExpanded: function (ctx, flag, callOpts) {
5425 node = ctx.node,
5426 tree = ctx.tree,
5427 opts = ctx.options,
5459 ctx.originalEvent
5506 ctx.tree._triggerNodeEvent(
5508 ctx
5514 ctx.tree._triggerNodeEvent(
5516 ctx
5531 ctx,
5536 tree._callHook("nodeRender", ctx, false, false, true);
5628 var source = tree._triggerNodeEvent("lazyLoad", node, ctx.originalEvent);
5631 this._callHook("nodeLoadChildren", ctx, source).done(function(){
5650 * @param {EventData} ctx
5653 nodeSetFocus: function (ctx, flag) {
5654 // ctx.node.debug("nodeSetFocus(" + flag + ")");
5656 tree = ctx.tree,
5657 node = ctx.node,
5659 // et = ctx.originalEvent && ctx.originalEvent.type,
5660 isInput = ctx.originalEvent
5661 ? $(ctx.originalEvent.target).is(":input")
5673 ctx2 = $.extend({}, ctx, { node: tree.focusNode });
5682 this._callHook("treeSetFocus", ctx, true, {
5705 this._triggerNodeEvent("focus", ctx);
5721 // tree.nodeSetActive(ctx, true);
5726 this._callHook("nodeRenderStatus", ctx);
5731 * @param {EventData} ctx
5739 nodeSetSelected: function (ctx, flag, callOpts) {
5741 var node = ctx.node,
5742 tree = ctx.tree,
5743 opts = ctx.options,
5750 // node.debug("nodeSetSelected(" + flag + ")", ctx);
5777 ctx.originalEvent
5805 this.nodeRenderStatus(ctx);
5808 tree._triggerNodeEvent("select", ctx);
5813 * @param {EventData} ctx
5819 nodeSetStatus: function (ctx, status, message, details) {
5820 var node = ctx.node,
5821 tree = ctx.tree;
5841 ctx,
5859 ctx,
5929 * @param {EventData} ctx
5931 nodeToggleExpanded: function (ctx) {
5932 return this.nodeSetExpanded(ctx, !ctx.node.expanded);
5935 * @param {EventData} ctx
5937 nodeToggleSelected: function (ctx) {
5938 var node = ctx.node,
5953 return this.nodeSetSelected(ctx, flag);
5956 * @param {EventData} ctx
5958 treeClear: function (ctx) {
5959 var tree = ctx.tree;
5965 tree._callHook("treeStructureChanged", ctx, "clear");
5968 * @param {EventData} ctx
5970 treeCreate: function (ctx) {},
5972 * @param {EventData} ctx
5974 treeDestroy: function (ctx) {
5981 * @param {EventData} ctx
5983 treeInit: function (ctx) {
5984 var tree = ctx.tree,
6020 this.treeLoad(ctx);
6023 * @param {EventData} ctx
6026 treeLoad: function (ctx, source) {
6030 tree = ctx.tree,
6031 $container = ctx.widget.element,
6034 rootCtx = $.extend({}, ctx, { node: this.rootNode });
6037 this.treeClear(ctx);
6117 ctx,
6121 if (ctx.options.selectMode === 3) {
6136 * @param {EventData} ctx
6140 treeRegisterNode: function (ctx, add, node) {
6141 ctx.tree._callHook(
6143 ctx,
6148 * @param {EventData} ctx
6151 treeSetFocus: function (ctx, flag, callOpts) {
6186 * @param {EventData} ctx
6190 treeSetOption: function (ctx, key, value) {
6191 var tree = ctx.tree,
6264 * @param {EventData} ctx
6266 treeStructureChanged: function (ctx, type) {},
6609 ctx = tree._makeHookContext(node || tree, event),
6628 res = tree._callHook("nodeKeydown", ctx);
6653 var ctx,
6663 ctx = tree._makeHookContext(node, event);
6669 ctx.targetType = et.type;
6674 ctx,
6681 ctx,
6685 : tree._callHook("nodeClick", ctx);
6687 ctx.targetType = et.type;
6690 ctx,
6694 : tree._callHook("nodeDblclick", ctx);
6814 * @param {any} [ctx]
6816 debounce: function (timeout, fn, invokeAsap, ctx) {
6819 ctx = invokeAsap;
6824 ctx = ctx || this;
6826 invokeAsap && !timer && fn.apply(ctx, args);
6830 invokeAsap || fn.apply(ctx, args);
7060 var ctx,
7067 ctx = {
7074 res = treeOpt.call(tree, { type: optionName }, ctx);
7123 tree.nodeSetExpanded(ctx, false);
7126 tree.nodeSetActive(ctx, true);
7190 $.ui.fancytree.overrideMethod(ctx.options, "createNode", function(event, data) {