Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

added in logged-in check for enabling the save button #385

Merged
merged 1 commit into from Mar 7, 2014

Conversation

Projects
None yet
2 participants
Contributor

Pomax commented Mar 7, 2014

No description provided.

@jbuck jbuck and 1 other commented on an outdated diff Mar 7, 2014

public/friendlycode/js/fc/ui/editor-toolbar.js
panes.codeMirror.on("change", function() {
- var codeLength = panes.codeMirror.getValue().trim().length;
- [saveButton].forEach(function(button) {
- button.attr("disabled", codeLength ? false : true);
- });
+ if($("html").hasClass("loggedin")) {
@jbuck

jbuck Mar 7, 2014

Owner

Instead of adding this on the parser.onchange event, why not have the webmaker-auth change the state of the save button in the event? Then you won't need to check this on every keypress

@Pomax

Pomax Mar 7, 2014

Contributor

the button disables right after saving, until you add new content (much like how popcorn works), so auth already "unlocks" it, but publishing may temporarily disable it again. Typing then unlocks it because the content changed since last publish (which caused the ticket's issue. If it unlocks without making sure the user's also already logged in, you can publish without logging in...)

@jbuck

jbuck Mar 7, 2014

Owner

That's downright logical!

@jbuck

jbuck Mar 7, 2014

Owner

Maybe cache the result of $("html") though

Pomax added a commit that referenced this pull request Mar 7, 2014

Merge pull request #385 from Pomax/savedisable
added in logged-in check for enabling the save button

@Pomax Pomax merged commit dc75a3d into mozilla:master Mar 7, 2014

@Pomax Pomax deleted the unknown repository branch Mar 7, 2014

gideonthomas added a commit to gideonthomas/thimble.mozilla.org that referenced this pull request Feb 8, 2017

Squashed 'services/login.webmaker.org/' changes from f761522..b4cf6f4
b4cf6f4 Merge pull request #385 from ryanwarsaw/remove-messina
e1234e1 Remove dependency on messina, Closes #368

git-subtree-dir: services/login.webmaker.org
git-subtree-split: b4cf6f4a27f00fc10fd639b2f48a604aafbbb81c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment