From 246cdedcd292286ab2391376b08e98f2fba2568b Mon Sep 17 00:00:00 2001 From: Rufus Pollock Date: Sun, 15 Jan 2012 17:41:55 +0000 Subject: [PATCH 1/3] [#19,routing][xs]: move history out to external calling code as we need to be able to reload the app (e.g. to change data source). --- demo/js/app.js | 1 + src/view.js | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/js/app.js b/demo/js/app.js index 470f7b34..33431f4f 100755 --- a/demo/js/app.js +++ b/demo/js/app.js @@ -7,6 +7,7 @@ $(function() { el: window.$container , model: dataset }); + Backbone.history.start(); setupLoadFromWebstore(function(dataset) { window.dataExplorer.remove(); window.dataExplorer = null; diff --git a/src/view.js b/src/view.js index 025e6f3d..064795f5 100644 --- a/src/view.js +++ b/src/view.js @@ -98,7 +98,6 @@ my.DataExplorer = Backbone.View.extend({ this.router = new Backbone.Router(); this.setupRouting(); - Backbone.history.start(); // retrieve basic data like headers etc // note this.model and dataset returned are the same From a369c63812d226c6f2c9a3d618ab0cbb6fb51d5b Mon Sep 17 00:00:00 2001 From: Rufus Pollock Date: Sun, 15 Jan 2012 19:05:06 +0000 Subject: [PATCH 2/3] [#8,Webstore][xs]: respect numDocs constraint in getDocuments. --- src/model.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/model.js b/src/model.js index e102063b..3f429986 100644 --- a/src/model.js +++ b/src/model.js @@ -214,7 +214,7 @@ my.BackendWebstore = Backbone.Model.extend({ } var base = this.get('url'); var jqxhr = $.ajax({ - url: base + '.json', + url: base + '.json?_limit=' + numRows, dataType: 'jsonp', jsonp: '_callback', cache: true From b008eba4ecbd2e1458c342406bdc30270bfd4fa8 Mon Sep 17 00:00:00 2001 From: Rufus Pollock Date: Sun, 15 Jan 2012 19:06:10 +0000 Subject: [PATCH 3/3] [#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. --- demo/js/app.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/demo/js/app.js b/demo/js/app.js index 33431f4f..a7cbff75 100755 --- a/demo/js/app.js +++ b/demo/js/app.js @@ -1,20 +1,21 @@ $(function() { - // do not like all these window globals ... - // window.$container = $('.container .right-panel'); - window.$container = $('.data-explorer-here'); + var $el = $('
'); + $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 = $('
'); + $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();