Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
59 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,27 @@ | ||
Template[getTemplate('css')].helpers({ | ||
hideAuthClass: function () { | ||
|
||
var authClass = ''; | ||
var authMethods = getSetting('authMethods', ["email"]); | ||
var selectors = [ | ||
{name: 'email', selector: ".at-pwd-form"}, | ||
{name: 'twitter', selector: "#at-twitter"}, | ||
{name: 'facebook', selector: "#at-facebook"} | ||
]; | ||
selectors.forEach(function (method) { | ||
// if current method is not one of the enabled auth methods, hide it | ||
if (authMethods.indexOf(method.name) == -1) { | ||
authClass += method.selector + ", "; | ||
} | ||
}); | ||
|
||
// unless we're showing at least one of twitter and facebook AND the password form, | ||
// hide separator | ||
if (authMethods.indexOf('email') == -1 || (authMethods.indexOf('facebook') == -1 && authMethods.indexOf('twitter') == -1)) { | ||
authClass += ".at-sep, "; | ||
} | ||
|
||
return authClass.slice(0, - 2) + "{display:none !important}"; | ||
|
||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters