mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
loginButtons is a template, not a helper
This commit is contained in:
@@ -1,10 +1,4 @@
|
||||
<!--
|
||||
NOTE: You shouldn't use these templates directly. Instead, use the global
|
||||
{{loginButtons}} template. For positioning on the right side of your app,
|
||||
try {{loginButtons align="right"}}
|
||||
-->
|
||||
|
||||
<template name="_loginButtons">
|
||||
<template name="loginButtons">
|
||||
<div id="login-buttons" class="login-buttons-dropdown-align-left">
|
||||
{{#if currentUser}}
|
||||
{{#if loggingIn}}
|
||||
|
||||
@@ -1,17 +1,8 @@
|
||||
// for convenience
|
||||
var loginButtonsSession = Accounts._loginButtonsSession;
|
||||
|
||||
Handlebars.registerHelper(
|
||||
"loginButtons",
|
||||
function (options) {
|
||||
if (options.hash.align === "right")
|
||||
return new Handlebars.SafeString(Template._loginButtons({align: "right"}));
|
||||
else
|
||||
return new Handlebars.SafeString(Template._loginButtons({align: "left"}));
|
||||
});
|
||||
|
||||
// shared between dropdown and single mode
|
||||
Template._loginButtons.events({
|
||||
Template.loginButtons.events({
|
||||
'click #login-buttons-logout': function() {
|
||||
Meteor.logout(function () {
|
||||
loginButtonsSession.closeDropdown();
|
||||
@@ -19,7 +10,7 @@ Template._loginButtons.events({
|
||||
}
|
||||
});
|
||||
|
||||
Template._loginButtons.preserve({
|
||||
Template.loginButtons.preserve({
|
||||
'input[id]': Spark._labelFromIdOrName
|
||||
});
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ var loginButtonsSession = Accounts._loginButtonsSession;
|
||||
|
||||
// events shared between loginButtonsLoggedOutDropdown and
|
||||
// loginButtonsLoggedInDropdown
|
||||
Template._loginButtons.events({
|
||||
Template.loginButtons.events({
|
||||
'click #login-name-link, click #login-sign-in-link': function () {
|
||||
loginButtonsSession.set('dropdownVisible', true);
|
||||
Deps.flush();
|
||||
|
||||
Reference in New Issue
Block a user