* fix: multi lines and spaces issues * fix: eslint operator-linebreak issue * fix: eslint quotes issue * fix: remaining quotes issues * fix: eslint object curly newline issue * fix: eslint object curly spacing issue * fix: eslint brace-style issues * fix: react jsx indent and props issues * fix: eslint trailing spaces issues * fix: eslint linbreak style issue * fix: eslint space unary operator issue * fix: eslint line around directives issue * fix: void and typeof space unary ops issue
49 lines
1.3 KiB
JavaScript
49 lines
1.3 KiB
JavaScript
(function(define) {
|
|
'use strict';
|
|
|
|
define([
|
|
'jquery',
|
|
'js/student_account/views/FormView'
|
|
],
|
|
function($, FormView) {
|
|
return FormView.extend({
|
|
el: '#password-reset-form',
|
|
|
|
tpl: '#password_reset-tpl',
|
|
|
|
events: {
|
|
'click .js-reset': 'submitForm',
|
|
'click .reset-help': 'toggleResetHelp'
|
|
},
|
|
|
|
formType: 'password-reset',
|
|
|
|
requiredStr: '',
|
|
optionalStr: '',
|
|
|
|
submitButton: '.js-reset',
|
|
|
|
preRender: function() {
|
|
this.element.show($(this.el));
|
|
this.element.show($(this.el).parent());
|
|
this.listenTo(this.model, 'sync', this.saveSuccess);
|
|
},
|
|
|
|
toggleResetHelp: function(event) {
|
|
var $help;
|
|
event.preventDefault();
|
|
$help = $('#reset-help');
|
|
this.toggleHelp(event, $help);
|
|
},
|
|
|
|
saveSuccess: function() {
|
|
this.trigger('password-email-sent');
|
|
|
|
// Destroy the view (but not el) and unbind events
|
|
this.$el.empty().off();
|
|
this.stopListening();
|
|
}
|
|
});
|
|
});
|
|
}).call(this, define || RequireJS.define);
|