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
2019-01-19 10:05:51 +01:00

26 lines
566 B
JavaScript

export default Ember.Component.extend({
classNames: ["create-account"],
didInsertElement() {
this._super(...arguments);
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(...arguments);
this.$().off("keydown.discourse-create-account");
}
});