Esempio n. 1
0
 this.autorun(() => {
   new SimpleSchema({
     key: { type: String },
     name: { type: String },
     type: { type: String, optional: true },
   }).validate(Template.currentData());
 });
Esempio n. 2
0
 this.autorun(() => {
   new SimpleSchema({
     element: { type: Elements._helpers },
     cid: { type: String },
     active: { type: String, optional: true },
     selection: { type: String, optional: true },
     menuPosition: { type: String, optional: true },
     setSelected: { type: Function, optional: true},
   }).validate(Template.currentData());
 });
Esempio n. 3
0
import { FlowRouter } from 'meteor/kadira:flow-router';
import { TAPi18n } from 'meteor/tap:i18n';

Template.Account_box.onCreated (function AccountBoxOnCreated() {
  this.state = new ReactiveDict();
  this.state.setDefault({
    userMenuOpen: false,
  });
});

Template.Account_box.onRendered (function AccountBoxOnRendered() {
});

Template.Account_box.helpers ({
  userMenuOpen() {
    const instance = Template.instance();
    return instance.state.get('userMenuOpen');
  },

  emailLocalPart() {
    const email = Meteor.user().emails[0].address;
    return email.substring(0, email.indexOf('@'));
  },

});

Template.Account_box.events ({
  'click .js-user-menu'(event, instance) {
    instance.state.set('userMenuOpen', !instance.state.get('userMenuOpen'));
    // stop the menu from closing
    event.stopImmediatePropagation();
Esempio n. 4
0
 viewClass: () => Template.instance().state.get('view'),
Esempio n. 5
0
 view_grid: () => Template.instance().state.equals('view', 'grid'),