Apply ESLint auto-fixes: debug_log_view.js
This commit is contained in:
parent
5d6cd0ea39
commit
d4c9422a99
1 changed files with 59 additions and 59 deletions
|
@ -3,64 +3,64 @@
|
|||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
window.Whisper = window.Whisper || {};
|
||||
|
||||
Whisper.DebugLogLinkView = Whisper.View.extend({
|
||||
templateName: 'debug-log-link',
|
||||
initialize: function(options) {
|
||||
initialize(options) {
|
||||
this.url = options.url;
|
||||
},
|
||||
render_attributes: function() {
|
||||
render_attributes() {
|
||||
return {
|
||||
url: this.url,
|
||||
reportIssue: i18n('reportIssue')
|
||||
reportIssue: i18n('reportIssue'),
|
||||
};
|
||||
}
|
||||
},
|
||||
});
|
||||
Whisper.DebugLogView = Whisper.View.extend({
|
||||
templateName: 'debug-log',
|
||||
className: 'debug-log modal',
|
||||
initialize: function() {
|
||||
initialize() {
|
||||
this.render();
|
||||
this.$('textarea').val(i18n('loading'));
|
||||
|
||||
window.log.fetch().then(function(text) {
|
||||
window.log.fetch().then((text) => {
|
||||
this.$('textarea').val(text);
|
||||
}.bind(this));
|
||||
});
|
||||
},
|
||||
events: {
|
||||
'click .submit': 'submit',
|
||||
'click .close': 'close'
|
||||
'click .close': 'close',
|
||||
},
|
||||
render_attributes: {
|
||||
title: i18n('submitDebugLog'),
|
||||
cancel: i18n('cancel'),
|
||||
submit: i18n('submit'),
|
||||
close: i18n('gotIt'),
|
||||
debugLogExplanation: i18n('debugLogExplanation')
|
||||
debugLogExplanation: i18n('debugLogExplanation'),
|
||||
},
|
||||
close: function(e) {
|
||||
close(e) {
|
||||
e.preventDefault();
|
||||
this.remove();
|
||||
},
|
||||
submit: function(e) {
|
||||
submit(e) {
|
||||
e.preventDefault();
|
||||
var text = this.$('textarea').val();
|
||||
const text = this.$('textarea').val();
|
||||
if (text.length === 0) {
|
||||
return;
|
||||
}
|
||||
log.publish(text).then(function(url) {
|
||||
var view = new Whisper.DebugLogLinkView({
|
||||
url: url,
|
||||
el: this.$('.result')
|
||||
log.publish(text).then((url) => {
|
||||
const view = new Whisper.DebugLogLinkView({
|
||||
url,
|
||||
el: this.$('.result'),
|
||||
});
|
||||
this.$('.loading').removeClass('loading');
|
||||
view.render();
|
||||
this.$('.link').focus().select();
|
||||
}.bind(this));
|
||||
});
|
||||
this.$('.buttons, textarea').remove();
|
||||
this.$('.result').addClass('loading');
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
})();
|
||||
}());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue