From 19187d09cef73e0455b37dcd8ccf33caae886d55 Mon Sep 17 00:00:00 2001 From: Jeroen Versteeg Date: Wed, 19 Jun 2013 12:57:57 +0200 Subject: [PATCH] TreeView's mapping of node to Widget fixed The mapping API changed in YUI 3.6.1, see 8cedb47 TreeView has to wait for Nodes to be instantiated before calling `Widget._mapInstance`, since the Node's yuid is used for mapping, not the DOM's id --- src/gallery-yui-treeview/js/TreeView.js | 3 +++ src/gallery-yui-treeview/js/TreeViewHTMLRenderer.js | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallery-yui-treeview/js/TreeView.js b/src/gallery-yui-treeview/js/TreeView.js index 5550723219..ea55f87022 100644 --- a/src/gallery-yui-treeview/js/TreeView.js +++ b/src/gallery-yui-treeview/js/TreeView.js @@ -266,6 +266,9 @@ Example usage: treeNode.append(childrenHTML); treeWidget.set("populated", true); + treeWidget.each(function (child) { + child._mapInstance(Y.stamp(child.get('boundingBox'))); + }, this); }, /** diff --git a/src/gallery-yui-treeview/js/TreeViewHTMLRenderer.js b/src/gallery-yui-treeview/js/TreeViewHTMLRenderer.js index bb9b00ca4e..2c9adcddd6 100644 --- a/src/gallery-yui-treeview/js/TreeViewHTMLRenderer.js +++ b/src/gallery-yui-treeview/js/TreeViewHTMLRenderer.js @@ -192,8 +192,6 @@ Y.WidgetHTMLRenderer.prototype = { } buffer.push(Handlebars.render(this.BOUNDING_TEMPLATE, context)); - - this._mapInstance(context.id); }, /** @@ -272,6 +270,7 @@ Y.WidgetHTMLRenderer.prototype = { // We need to setup bb/cb references, before bind/sync for backwards compat this.syncRenderedBoxes(); + this._mapInstance(Y.stamp(this.get('boundingBox'))); this._bindUI(); this.bindUI();