diff options
| author | Greg Roach <fisharebest@webtrees.net> | 2019-10-22 22:41:17 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@webtrees.net> | 2019-10-22 23:06:54 +0100 |
| commit | 06f42609e3f1764a2e55be21f0ce941f29f42167 (patch) | |
| tree | 10927479844b264366bbeb6c67f242f5b35e9b13 /resources/js | |
| parent | 1e65345293efca3993945bfd7b2e1fdb9103d8bc (diff) | |
| download | webtrees-06f42609e3f1764a2e55be21f0ce941f29f42167.tar.gz webtrees-06f42609e3f1764a2e55be21f0ce941f29f42167.tar.bz2 webtrees-06f42609e3f1764a2e55be21f0ce941f29f42167.zip | |
Fix: #2678 URLs for interactive tree need to be generated on the server
Diffstat (limited to 'resources/js')
| -rw-r--r-- | resources/js/treeview.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/resources/js/treeview.js b/resources/js/treeview.js index 0b2f1b90f7..02a3052af5 100644 --- a/resources/js/treeview.js +++ b/resources/js/treeview.js @@ -24,8 +24,8 @@ function TreeViewHandler(treeview_instance, ged) { this.boxWidth = 180; // default family box width this.boxExpandedWidth = 250; // default expanded family box width this.cookieDays = 3; // lifetime of preferences memory, in days - this.ajaxUrl1 = "index.php?route=/module/tree/"; - this.ajaxUrl2 = "&ged=" + encodeURIComponent(ged) + "&instance=" + treeview_instance; + this.ajaxDetails = document.getElementById(treeview_instance + "_out").dataset.urlDetails + "?instance=" + encodeURIComponent(treeview_instance); + this.ajaxPersons = document.getElementById(treeview_instance + "_out").dataset.urlIndividuals + "?instance=" + encodeURIComponent(treeview_instance); this.container = this.treeview.parent(); // Store the container element ("#" + treeview_instance + "_out") this.auto_box_width = false; @@ -176,7 +176,7 @@ TreeViewHandler.prototype.updateTree = function (center, button) { tv.updating = true; tv.setLoading(); jQuery.ajax({ - url: tv.ajaxUrl1 + "Persons" + tv.ajaxUrl2, + url: tv.ajaxPersons, dataType: "json", data: "q=" + to_load.join(";"), success: function (ret) { @@ -311,7 +311,7 @@ TreeViewHandler.prototype.expandBox = function (box, event) { tv.updating = true; tv.setLoading(); // perform the Ajax request and load the result in the box - box.load(tv.ajaxUrl1 + "Details&pid=" + pid + tv.ajaxUrl2, function () { + box.load(tv.ajaxDetails + "&pid=" + encodeURIComponent(pid), function () { // If Lightbox module is active, we reinitialize it for the new links if (typeof CB_Init === "function") { CB_Init(); |
