Permalink
Browse files

gallery-2012.05.09-20-27 jafl gallery-treeble

  • Loading branch information...
1 parent a6aa97d commit 2819d8b05502d2a26327229c6a905b6c8b629f80 YUI Builder committed May 9, 2012
@@ -1,6 +1,11 @@
.yui3-skin-sam .yui3-datatable td.treeble-nub
{
border-right-color: transparent;
+ cursor: pointer;
+}
+.yui3-skin-sam .yui3-datatable td.treeble-value
+{
+ border-left-color: transparent;
}
.yui3-skin-sam .yui3-datatable .row-toggle a.treeble-expand-nub
@@ -38,22 +38,21 @@ Treeble.buildTwistdownFormatter = function(sendRequest)
if (o.data[key])
{
- var path = o.data._yui_node_path;
- var open = ds.isOpen(path);
- var clazz = open ? 'row-open' : 'row-closed';
+ var path = o.data._yui_node_path;
o.td.addClass('row-toggle');
- o.td.replaceClass(/row-(open|closed)/, clazz);
+ o.td.replaceClass('row-(open|closed)',
+ ds.isOpen(path) ? 'row-open' : 'row-closed');
- o.td.on('click', function()
+ YUI.Env.add(Y.Node.getDOMNode(o.td), 'click', function()
{
ds.toggle(path, {}, sendRequest);
});
o.cell.set('innerHTML', '<a class="treeble-expand-nub" href="javascript:void(0);"></a>');
}
- return true; // keep the Y.Node instances
+ return false; // discard Y.Node instances
};
};
@@ -66,6 +65,8 @@ Treeble.buildTwistdownFormatter = function(sendRequest)
Treeble.treeValueFormatter = function(o)
{
var depth_class = 'treeble-depth-'+o.data._yui_node_depth;
+ o.rowClass += ' ' + depth_class;
+ o.className += ' treeble-value';
return '<span class="'+depth_class+'">'+o.value+'</span>';
};
@@ -724,8 +724,8 @@ function checkFinished()
return;
}
- var response = {};
- Y.mix(response, this._topResponse);
+ var response = { meta:{} };
+ Y.mix(response, this._topResponse, true);
response.results = [];
response = Y.clone(response, true);
@@ -941,6 +941,7 @@ Y.extend(TreebleDataSource, Y.DataSource.Local,
{
this._req = [];
this._toggle = [];
+ delete this._topResponse;
}
});

0 comments on commit 2819d8b

Please sign in to comment.