Merge pull request #409 from normann/sapphire

---

Add page icons to the tree node in TreeDropdownField in page add form.
This commit is contained in:
Ingo Schommer 2012-05-07 11:02:59 +02:00
commit bed5655d5e

View File

@ -122,9 +122,11 @@
var updateFn = function() { var updateFn = function() {
var val = self.getValue(); var val = self.getValue();
if(val) { if(val) {
var node = tree.find('*[data-id="' + val + '"]'), var node = tree.find('*[data-id="' + val + '"]'),
title = (node) ? tree.jstree('get_text', node[0]) : 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) self.setTitle(title); if(title) self.setTitle(title);
if(node) tree.jstree('select_node', node); if(node) tree.jstree('select_node', node);
} }