mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUG Fix JS issues in treedropdownfield for link editor
This commit is contained in:
parent
dfdb274773
commit
eaf0fe4b2f
@ -114,7 +114,7 @@
|
|||||||
|
|
||||||
var node = tree.find('*[data-id="' + val + '"]'),
|
var node = tree.find('*[data-id="' + val + '"]'),
|
||||||
title = node.children('a').find("span.jstree_pageicon")?node.children('a').find("span.item").html():null;
|
title = node.children('a').find("span.jstree_pageicon")?node.children('a').find("span.item").html():null;
|
||||||
if(!title) title=(node) ? tree.jstree('get_text', node[0]) : null;
|
if(!title) title=(node.length > 0) ? tree.jstree('get_text', node[0]) : null;
|
||||||
|
|
||||||
if(title) self.setTitle(title);
|
if(title) self.setTitle(title);
|
||||||
if(node) tree.jstree('select_node', node);
|
if(node) tree.jstree('select_node', node);
|
||||||
@ -122,8 +122,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Load the tree if its not already present
|
// Load the tree if its not already present
|
||||||
if(jQuery.jstree._reference(tree) || !val) updateFn();
|
if(!tree.is(':empty') || !val) updateFn();
|
||||||
else this.loadTree(null, updateFn);
|
else this.loadTree({forceValue: val}, updateFn);
|
||||||
},
|
},
|
||||||
setValue: function(val) {
|
setValue: function(val) {
|
||||||
this.data('metadata', $.extend(this.data('metadata'), {id: val}));
|
this.data('metadata', $.extend(this.data('metadata'), {id: val}));
|
||||||
|
Loading…
Reference in New Issue
Block a user