This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/components/create-account.js.es6
Joffrey JAFFEUX f9648de897
DEV: upgrades from Ember 2.13 to Ember 3.5.1 (#6808)
Co-Authored-By: Bianca Nenciu <nbianca@users.noreply.github.com>
Co-Authored-By: David Taylor <david@taylorhq.com>
2019-01-10 11:06:01 +01:00

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");
}
});