From bdb166c829a660ad5188ae0a5b9d50f3677fa2dc Mon Sep 17 00:00:00 2001 From: Sacha Greif Date: Fri, 4 Jul 2014 11:49:52 +0900 Subject: [PATCH 01/10] debugging loading bug --- .meteor/packages | 1 - client/main.js | 4 +++- client/views/errors/loading.html | 1 + client/views/errors/loading.js | 5 +++++ lib/router.js | 8 ++++---- smart.json | 1 - smart.lock | 6 ------ 7 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 client/views/errors/loading.js diff --git a/.meteor/packages b/.meteor/packages index 8e9694a8b..2c096641b 100644 --- a/.meteor/packages +++ b/.meteor/packages @@ -22,7 +22,6 @@ spin autoform collection2 accounts-facebook -iron-router-progress telescope-tags telescope-base telescope-search diff --git a/client/main.js b/client/main.js index ea3db2122..59410f4e7 100644 --- a/client/main.js +++ b/client/main.js @@ -57,4 +57,6 @@ Deps.autorun(function() { if(Meteor.userId()) { Meteor.subscribe('notifications'); } -}); \ No newline at end of file +}); + +Deps.autorun(function() { console.log(Posts.find().count()); }) \ No newline at end of file diff --git a/client/views/errors/loading.html b/client/views/errors/loading.html index 9e6a32234..e6ee05f9d 100644 --- a/client/views/errors/loading.html +++ b/client/views/errors/loading.html @@ -2,4 +2,5 @@
{{>spinner}}
+ {{log}} \ No newline at end of file diff --git a/client/views/errors/loading.js b/client/views/errors/loading.js new file mode 100644 index 000000000..8c4b36e0d --- /dev/null +++ b/client/views/errors/loading.js @@ -0,0 +1,5 @@ +Template.loading.helpers({ + log: function () { + console.log('loading…') + } +}) \ No newline at end of file diff --git a/lib/router.js b/lib/router.js index 75447351e..1202bc300 100644 --- a/lib/router.js +++ b/lib/router.js @@ -98,7 +98,7 @@ preloadSubscriptions.push('allUsersAdmin'); Router.configure({ layoutTemplate: 'layout', - loadingTemplate: 'loading', + // loadingTemplate: 'loading', notFoundTemplate: 'not_found', waitOn: function () { return _.map(preloadSubscriptions, function(sub){ @@ -121,7 +121,7 @@ Router._filters = { isReady: function(pause) { if (!this.ready()) { // console.log('not ready') - this.render('loading'); + // this.render('loading'); pause(); }else{ // console.log('ready') @@ -159,7 +159,7 @@ Router._filters = { canView: function(pause) { if(!this.ready() || Meteor.loggingIn()){ - this.render('loading'); + // this.render('loading'); pause(); }else if (!canView()) { this.render('no_rights'); @@ -169,7 +169,7 @@ Router._filters = { canPost: function (pause) { if(!this.ready() || Meteor.loggingIn()){ - this.render('loading'); + // this.render('loading'); pause(); }else if(!canPost()){ throwError(i18n.t("Sorry, you don't have permissions to add new items.")); diff --git a/smart.json b/smart.json index 47241f677..2e5254026 100644 --- a/smart.json +++ b/smart.json @@ -8,7 +8,6 @@ "fast-render": {}, "spin": {}, "autoform": {}, - "iron-router-progress": {}, "jquery-hotkeys": {}, "marked": {}, "bootstrap3-datepicker": {} diff --git a/smart.lock b/smart.lock index e7c7a77bf..524a53924 100644 --- a/smart.lock +++ b/smart.lock @@ -9,7 +9,6 @@ "fast-render": {}, "spin": {}, "autoform": {}, - "iron-router-progress": {}, "jquery-hotkeys": {}, "marked": {}, "bootstrap3-datepicker": {} @@ -50,11 +49,6 @@ "tag": "v0.13.5", "commit": "27dd5b912eeba687b228a6a7c2c14eef63b12cca" }, - "iron-router-progress": { - "git": "https://github.com/Multiply/iron-router-progress.git", - "tag": "v0.4.1", - "commit": "496fcda9a6ec352b4733725f60c6f280250c3541" - }, "jquery-hotkeys": { "git": "https://github.com/terryschen/meteor-jquery-hotkeys.git", "tag": "v0.0.1", From f24dee88cb37e01e92f0e470a4964b8c824c1f6b Mon Sep 17 00:00:00 2001 From: Sacha Greif Date: Fri, 4 Jul 2014 12:10:09 +0900 Subject: [PATCH 02/10] setting post limit through session --- lib/router.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/router.js b/lib/router.js index 1202bc300..83a041268 100644 --- a/lib/router.js +++ b/lib/router.js @@ -289,7 +289,9 @@ PostsListController = FastRender.RouteController.extend({ ]; }, data: function () { - var parameters = getParameters(this._terms), + var newterms = this._terms; + newterms.limit = Session.get('newlimit') || 10; + var parameters = getParameters(newterms), posts = Posts.find(parameters.find, parameters.options); postsCount = posts.count(); From abe8f45cbc4f8fae977cdaf5b2e54d067ecbd878 Mon Sep 17 00:00:00 2001 From: Sacha Greif Date: Fri, 4 Jul 2014 14:22:21 +0900 Subject: [PATCH 03/10] fixing loading more posts bug --- client/main.js | 4 +-- client/views/errors/loading.html | 2 +- lib/router.js | 26 ++++++++++++------- .../lib/client/sass/partials/_main.scss | 4 +-- .../lib/client/stylesheets/screen.css | 2 +- 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/client/main.js b/client/main.js index 59410f4e7..ea3db2122 100644 --- a/client/main.js +++ b/client/main.js @@ -57,6 +57,4 @@ Deps.autorun(function() { if(Meteor.userId()) { Meteor.subscribe('notifications'); } -}); - -Deps.autorun(function() { console.log(Posts.find().count()); }) \ No newline at end of file +}); \ No newline at end of file diff --git a/client/views/errors/loading.html b/client/views/errors/loading.html index e6ee05f9d..504473d0f 100644 --- a/client/views/errors/loading.html +++ b/client/views/errors/loading.html @@ -1,5 +1,5 @@