(function ($) { //jquery plugin for our tree picker $.fn.MultiNodeTreePicker = function (ctlId, maxItems, tooltipAjaxUrl, showTooltip, showThumbnail, umbPath, treeType) { /* internal properties */ var $tree = $(this); var ctl = $("#" + ctlId); var hiddenField = ctl.find("input[type='hidden']"); var rightCol = ctl.find(".right"); var tooltip = null; //the tooltip object (will be defined when it is shown) var throbber = null; var collapseNode = null; //this is used to track collapsing of tree nodes due to the issue of the nodeClicked event being fired on tree collapse //store a reference to the hidden field in the right columns data collection rightCol.data("hiddenField", hiddenField); function getPosition(trigger, tip, conf) { // get origin top/left position var top = trigger.offset().top, left = trigger.offset().left, pos = conf.position[0]; top -= tip.outerHeight() - conf.offset[0]; left += trigger.outerWidth() + conf.offset[1]; // adjust Y var height = tip.outerHeight() + trigger.outerHeight(); if (pos == 'center') { top += height / 2; } if (pos == 'bottom') { top += height; } // adjust X pos = conf.position[1]; var width = tip.outerWidth() + trigger.outerWidth(); if (pos == 'center') { left -= width / 2; } if (pos == 'left') { left -= width; } return { top: top, left: left }; } //used to create the tooltip var tooltipOptions = { tip: "#MNTPTooltip", effect: "fade", predelay: 0, position: 'center left', relative: true, offset: [30, 0], onShow: function () { //get the id of the item being queried var id = this.getTrigger().next().find("li").attr("rel"); $.ajax({ type: "POST", data: "{\"id\": " + id + "}", dataType: "json", url: tooltipAjaxUrl, contentType: "application/json; charset=UTF-8", success: function (data) { var newLocation = (treeType == "content" ? umbPath + "/editContent.aspx?id=" : umbPath + "/editMedia.aspx?id=") + data.d.Id; var h = $("[edit]
Path: " + data.d.Path + "
" + data.d.PathAsNames + "
"); h.click(function () { if (!confirm("Are you sure you want to navigate away from this page?\n\nYou may have unsaved changes.\n\nPress OK to continue or Cancel to stay on the current page.")) { return false; } //this is a VERY dodgy work around for deep linking between sections and pages var iframe = UmbClientMgr.mainWindow().jQuery("#deepLinkScriptFrame"); if (iframe.length == 0) { var html = ""; iframe = UmbClientMgr.mainWindow().jQuery("