Co-Authored-By: Bianca Nenciu <nbianca@users.noreply.github.com> Co-Authored-By: David Taylor <david@taylorhq.com>
26 lines
542 B
JavaScript
26 lines
542 B
JavaScript
export default Ember.Component.extend({
|
|
classNames: ["create-account"],
|
|
|
|
didInsertElement() {
|
|
this._super();
|
|
|
|
if ($.cookie("email")) {
|
|
this.set("email", $.cookie("email"));
|
|
}
|
|
|
|
this.$().on("keydown.discourse-create-account", e => {
|
|
if (!this.get("disabled") && e.keyCode === 13) {
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
this.action();
|
|
return false;
|
|
}
|
|
});
|
|
},
|
|
|
|
willDestroyElement() {
|
|
this._super();
|
|
this.$().off("keydown.discourse-create-account");
|
|
}
|
|
});
|