From bfcd7b72eba2ad24677e23b46da006346a779557 Mon Sep 17 00:00:00 2001 From: Mumu Des Bois Date: Wed, 22 Jun 2016 20:00:06 +0200 Subject: [PATCH] save --- client/animation/animation.js | 8 +++++--- client/controllers/global.js | 5 +++-- client/controllers/index.js | 3 +++ client/controllers/profile.js | 10 +++++++++- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/client/animation/animation.js b/client/animation/animation.js index 269079b..7aa336c 100644 --- a/client/animation/animation.js +++ b/client/animation/animation.js @@ -7,7 +7,7 @@ Template.inbox.uihooks({ wrapper = $(node).children('.wrapper2-animation'); wrapper.velocity('transition.slideLeftBigIn',{ duration: 500, - + }) }else{ $(node).velocity('transition.slideLeftBigIn',{ @@ -56,7 +56,8 @@ Template.conversation.uihooks({ $(node).insertBefore(next); wrapper = $(node).children('.wrapper-animation'); wrapper.velocity('transition.slideLeftBigIn',{ - duration: 500 + duration: 500, + display: 'flex' }); }, @@ -81,7 +82,8 @@ Template.profile.uihooks({ insert: function(node, next, tp1) { $(node).insertBefore(next); $(node).velocity('transition.slideDownBigIn',{ - duration: 500 + duration: 500, + display : 'flex' }); }, diff --git a/client/controllers/global.js b/client/controllers/global.js index d024056..2d557f5 100644 --- a/client/controllers/global.js +++ b/client/controllers/global.js @@ -50,7 +50,7 @@ registerHelper = { n = _.flattenDeep(notices); sort = _.sortBy(n, function(el){ - + return el.createdAt; }) m = _.meanBy( n , function(el) { return el.grade; }); @@ -59,7 +59,8 @@ registerHelper = { array : _.reverse(sort), nb : n.length, percent : round * 100 / 5 || 100, - average :round || '5' + average :round || '5', + noNotices : n.length == 0 }; }, userService : function(id){ diff --git a/client/controllers/index.js b/client/controllers/index.js index 0c42afb..0570660 100644 --- a/client/controllers/index.js +++ b/client/controllers/index.js @@ -149,6 +149,9 @@ Template.index.events({ }, 'click .icon-menu' : function(){ $('.menu, .icon-menu').toggleClass('menu--open'); + }, + 'click .menu a' : function(){ + $('.menu, .icon-menu').removeClass('menu--open'); } }); diff --git a/client/controllers/profile.js b/client/controllers/profile.js index 9d9c962..9449c07 100644 --- a/client/controllers/profile.js +++ b/client/controllers/profile.js @@ -37,6 +37,14 @@ Template.profile.helpers({ return { percent: this.grade*100/5 } - } + }, + + 'nolessons' : function(){ + return Lessons.find({ + 'private.owner' : this._id, + }).count() == 0 + + }, + });