mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Merge remote-tracking branch 'origin/shark-domrange-accounts-ui' into shark
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
-->
|
||||
|
||||
<template name="_loginButtons">
|
||||
<div id="login-buttons" class="login-buttons-dropdown-align-{{align}}">
|
||||
<div id="login-buttons" class="login-buttons-dropdown-align-left">
|
||||
{{#if currentUser}}
|
||||
{{#if loggingIn}}
|
||||
{{! We aren't actually logged in yet; we're just setting Meteor.userId
|
||||
|
||||
@@ -97,12 +97,10 @@
|
||||
</div>
|
||||
<a class="accounts-close configure-login-service-dismiss-button">×</a>
|
||||
|
||||
{{#isolate}}
|
||||
<div class="login-button login-button-configure {{#if saveDisabled}}login-button-disabled{{/if}}"
|
||||
<div class="login-button login-button-configure {{additionalClasses}}"
|
||||
id="configure-login-service-dialog-save-configuration">
|
||||
Save Configuration
|
||||
</div>
|
||||
{{/isolate}}
|
||||
Save Configuration
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
@@ -226,8 +226,11 @@ Template._configureLoginServiceDialog.configurationSteps = function () {
|
||||
return configureLoginServiceDialogTemplateForService()();
|
||||
};
|
||||
|
||||
Template._configureLoginServiceDialog.saveDisabled = function () {
|
||||
return loginButtonsSession.get('configureLoginServiceDialogSaveDisabled');
|
||||
Template._configureLoginServiceDialog.additionalClasses = function () {
|
||||
if (loginButtonsSession.get('configureLoginServiceDialogSaveDisabled'))
|
||||
return "login-button-disabled";
|
||||
else
|
||||
return "";
|
||||
};
|
||||
|
||||
// XXX from http://epeli.github.com/underscore.string/lib/underscore.string.js
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template name="_loginButtonsLoggedOutSingleLoginButton">
|
||||
<div class="login-text-and-button">
|
||||
<div class="login-button single-login-button {{#unless configured}}configure-button{{/unless}}"
|
||||
<div class="login-button single-login-button {{additionalClasses}}"
|
||||
id="login-buttons-{{name}}">
|
||||
<div class="login-image" id="login-buttons-image-{{name}}"></div>
|
||||
{{#if configured}}
|
||||
|
||||
@@ -29,8 +29,11 @@ Template._loginButtonsLoggedOutSingleLoginButton.events({
|
||||
}
|
||||
});
|
||||
|
||||
Template._loginButtonsLoggedOutSingleLoginButton.configured = function () {
|
||||
return !!ServiceConfiguration.configurations.findOne({service: this.name});
|
||||
Template._loginButtonsLoggedOutSingleLoginButton.additionalClasses = function () {
|
||||
if (!!ServiceConfiguration.configurations.findOne({service: this.name}))
|
||||
return "";
|
||||
else
|
||||
return "configure-button";
|
||||
};
|
||||
|
||||
Template._loginButtonsLoggedOutSingleLoginButton.capitalizedName = function () {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Template = {};
|
||||
|
||||
Template = {};
|
||||
/*
|
||||
var registeredPartials = {};
|
||||
|
||||
// If minimongo is available (it's a weak dependency) use its ID stringifier to
|
||||
|
||||
@@ -27,8 +27,8 @@ UI.If = Component.extend({
|
||||
init: function () {
|
||||
// XXX this probably deserves a better explanation if this code is
|
||||
// going to stay with us.
|
||||
|
||||
this.condition = this.data;
|
||||
|
||||
// content doesn't see the condition as `data`
|
||||
delete this.data;
|
||||
// XXX I guess this means it's kosher to mutate properties
|
||||
@@ -39,7 +39,13 @@ UI.If = Component.extend({
|
||||
var self = this;
|
||||
// re-render if and only if condition changes
|
||||
var condition = Deps.isolateValue(function () {
|
||||
return !! self.get('condition');
|
||||
var cond = self.get('condition');
|
||||
|
||||
// empty arrays are treated as falsey values
|
||||
if (cond instanceof Array && cond.length === 0)
|
||||
return false;
|
||||
else
|
||||
return !! cond;
|
||||
});
|
||||
|
||||
buf.write(condition ? self.content : self.elseContent);
|
||||
@@ -56,7 +62,13 @@ UI.Unless = Component.extend({
|
||||
var self = this;
|
||||
// re-render if and only if condition changes
|
||||
var condition = Deps.isolateValue(function () {
|
||||
return !! self.get('condition');
|
||||
var cond = self.get('condition');
|
||||
|
||||
// empty arrays are treated as falsey values
|
||||
if (cond instanceof Array && cond.length === 0)
|
||||
return false;
|
||||
else
|
||||
return !! cond;
|
||||
});
|
||||
|
||||
buf.write(condition ? self.elseContent : self.content);
|
||||
|
||||
Reference in New Issue
Block a user