[#19,demo][s]: fix up secondarily load of webstore table in demo.

* Had been broken by f176979f5bd39e78e0c66c27dced3f7c8b2dc49b with its change to use passed in element to DataExplorer rather than internal generation of element.
This commit is contained in:
Rufus Pollock 2012-01-15 19:06:10 +00:00
parent a369c63812
commit b008eba4ec

View File

@ -1,20 +1,21 @@
$(function() {
// do not like all these window globals ...
// window.$container = $('.container .right-panel');
window.$container = $('.data-explorer-here');
var $el = $('<div />');
$el.appendTo($('.data-explorer-here'));
var dataset = demoDataset();
window.dataExplorer = new recline.View.DataExplorer({
el: window.$container
el: $el
, model: dataset
});
Backbone.history.start();
setupLoadFromWebstore(function(dataset) {
window.dataExplorer.remove();
var $el = $('<div />');
$el.appendTo($('.data-explorer-here'));
window.dataExplorer = null;
window.dataExplorer = new recline.View.DataExplorer({
model: dataset,
el: $el
, model: dataset
});
window.$container.append(window.dataExplorer.el);
});
$('a.set-read-only').click(function() {
window.dataExplorer.setReadOnly();