import { Template } from 'meteor/templating'; import './nav.html'; Template.nav.helpers({ nameApp(){ return "UI Examples"; } });
import './nav.html'; import { Template } from 'meteor/templating'; Template.nav.helpers({ routes(){ return [ ['/recent','Recent'], ].concat(Meteor.userId()?[ ['/my-pins','My Pins'], ['/add','Add'], ]:[]).map( (a)=>{return {url:a[0],desc:a[1]};} ); } }); Template.nav.rendered = ()=>{ $('#login-dropdown-list a') .removeClass() .addClass("dropdown-toggle"); }
return false; } else { return true; } } }] }); Accounts.onLogin( function(){ FlowRouter.go("/"); }); Template.nav.events({ "click #login-buttons-logout": function(){ FlowRouter.go("/"); }, }); /*var TEMPLATE= new ReactiveVar("layout"); menu=[{name: "Principal", template:"layout"}, {name: "References", template:"references"}, {name: "Blog", template:"blog"}, {name: "Gallery", template:"galery"}] Template.nav.helpers({ menu:function(){ return menu; }
import { Template } from 'meteor/templating'; import { $ } from 'meteor/jquery'; import { Invites } from '../../api/invites/invites.js'; import './nav.html'; Template.nav.onRendered(() => { $('.button-collapse').sideNav(); }); Template.nav.helpers({ invitesCounter() { return Invites.find().count(); }, });
} parent.addClass('editable'); } }); Template.nav.onRendered(() => { // TODO: This is the only way to ensure that all the proper pieces have been inserted // into the DOM. document.ready doesn't work because the document will think it is ready // because we're doing reactive conditional statements in the template. This type of // functionality should be avoided, and probably another reason to see how ReactJS handles // something like this. setTimeout(() => { $('.dropdown-button').dropdown({ inDuration: 300, outDuration: 225, constrain_width: false, hover: false, alignment: 'right', gutter: 0, belowOrigin: true }); $('.button-collapse').sideNav({ menuWidth: 240, activationWidth: 70, closeOnClick: true }); }, 600); });