meteor-blaze

TypeError: Chartist.plugins.legend is not a function

こ雲淡風輕ζ 提交于 2021-01-28 21:30:30
问题 I'm have recently started use Meteor build tool with Chartist to represent my data. I have java script for legend template (source from internet) Template.js function drawBarChart() { new Chartist.Bar('.legendChart1', { labels: ['First quarter of the year', 'Second quarter of the year', 'Third quarter of the year', 'Fourth quarter of the year'], series: [ { "name": "Money A", "data": [60000, 40000, 80000, 70000] }, { "name": "Money B", "data": [40000, 30000, 70000, 65000] } ] }, { plugins: [

Meteor.js onRendered not triggered for dynamic template on data change

前提是你 提交于 2021-01-28 21:28:32
问题 I'm trying to integrate a dynamic template called "page-event" on "page-main" which depends on data from a helper: HTML MAIN {{>Template.dynamic template="page-event" data=selectedEvent}} JS MAIN Template["page-main"].helpers({ selectedEvent: function() { var eventId = Template.instance().selectedEventId.get() event = Collections.Events.findOne(eventId); return { event: event }; } }); JS EVENT Template["page-event"].onRendered(function() { const ti = this; var eventData = this.data.event;

logout a meteor user on window/tab close but not on page refresh.

余生颓废 提交于 2021-01-28 07:40:35
问题 I have used window.onbeforeunload to logout a meteor user on browser tab close. It works fine with tab close but my user gets log out on page refresh which I do not want. Is there any solution to this problem. I want user to not logout on page refresh. I am new in Meteor. Any help would be highly appreciated. The code I have used for this is window.onbeforeunload = function() { Meteor.logout(); } 回答1: I'm kinda new to meteor too and after many tries I found this solution : if (sessionStorage

{{#if currentUser}} with icon inside still rendered when user logs out

十年热恋 提交于 2021-01-27 19:52:37
问题 Thank you for reading my message, here is my problem : I'm using a navbar made with Bulma in which I display either login/register buttons or a profile picture icon from FontAwesome using {{#if currentUser}} as shown below ("S'inscrire" and "Se connecter" means register and login in French) : <div class="navbar-end"> <div class="navbar-item"> <div class="buttons"> {{#if currentUser}} <!-- Displayed only when the user is logged in--> <i class="fas fa-user icon is-large" id="userProfile"></i> {

Chrome seems to define 'event' variable in Meteor/Blaze [duplicate]

萝らか妹 提交于 2020-05-18 09:00:19
问题 This question already has an answer here : Why is 'event' variable available even when not passed as a parameter? (1 answer) Closed 4 days ago . I'm developing using mostly Chrome. I just discovered a bug, where the following snippet was working fine in Chrome, but not in Firefox. Template.myTemplate.events({ "click input[type=checkbox]"(){ let context = event.target.dataset.context; InspireTheWorldWith.call({context}); } }); I could not quite believe my eyes, but essentially the variable

Chrome seems to define 'event' variable in Meteor/Blaze [duplicate]

安稳与你 提交于 2020-05-18 08:55:19
问题 This question already has an answer here : Why is 'event' variable available even when not passed as a parameter? (1 answer) Closed 4 days ago . I'm developing using mostly Chrome. I just discovered a bug, where the following snippet was working fine in Chrome, but not in Firefox. Template.myTemplate.events({ "click input[type=checkbox]"(){ let context = event.target.dataset.context; InspireTheWorldWith.call({context}); } }); I could not quite believe my eyes, but essentially the variable

How to display children of “publish-composite collection” on Template View

痴心易碎 提交于 2020-02-08 02:30:10
问题 Considering the example given at https://github.com/englue/meteor-publish-composite How to display nested children on the template view. I mean, displaying top 2 comments on the post on the view. I have searched a lot over internet for this children tree display on Template View, didn't find any. Code publishComposite('topTenPosts', { find() { // Find top ten highest scoring posts return Posts.find({}, { sort: { score: -1 }, limit: 10 }); }, children: [ { find(post) { // Find post author.

4 level subscription nesting in meteor

。_饼干妹妹 提交于 2020-02-03 10:19:10
问题 I am using meteor and this is my schema, each is a separate collection: Courses has many lectures Lectures have many questions Questions have many answers I want 1 page where I can display a given course's lectures, questions, and answers. I can display a course's lectures no problem but I have issues with displaying further nested items. I'd ideally like to have: Lecture has courseId Answer has lectureId (but not courseId) Question has answerId (but not lectureId or courseId) Is that wise or

Making bootstrap calendar render when data change in meteor

你说的曾经没有我的故事 提交于 2020-01-16 19:18:06
问题 I'm still struggling to get a calendar to re-render when data changes using meteor blaze. I have put in place an observerChanges function that is firing happily when added, removed or changed are triggered, but I have NO idea how to actually make the calendar update its state. The handler code is Meteor.subscribe("reqEvents"); allReqsCursor = Requests.find(); var handle = allReqsCursor.observeChanges({ added: function (id, user) { console.log("Request added"); }, removed: function () {

Making bootstrap calendar render when data change in meteor

让人想犯罪 __ 提交于 2020-01-16 19:18:02
问题 I'm still struggling to get a calendar to re-render when data changes using meteor blaze. I have put in place an observerChanges function that is firing happily when added, removed or changed are triggered, but I have NO idea how to actually make the calendar update its state. The handler code is Meteor.subscribe("reqEvents"); allReqsCursor = Requests.find(); var handle = allReqsCursor.observeChanges({ added: function (id, user) { console.log("Request added"); }, removed: function () {