Apply ESLint auto-fixes: `debug_log_view.js`

pull/1/head
Daniel Gasienica 7 years ago
parent 5d6cd0ea39
commit d4c9422a99

@ -3,64 +3,64 @@
*/ */
(function () { (function () {
'use strict'; 'use strict';
window.Whisper = window.Whisper || {}; window.Whisper = window.Whisper || {};
Whisper.DebugLogLinkView = Whisper.View.extend({ Whisper.DebugLogLinkView = Whisper.View.extend({
templateName: 'debug-log-link', templateName: 'debug-log-link',
initialize: function(options) { initialize(options) {
this.url = options.url; this.url = options.url;
}, },
render_attributes: function() { render_attributes() {
return { return {
url: this.url, url: this.url,
reportIssue: i18n('reportIssue') reportIssue: i18n('reportIssue'),
}; };
} },
}); });
Whisper.DebugLogView = Whisper.View.extend({ Whisper.DebugLogView = Whisper.View.extend({
templateName: 'debug-log', templateName: 'debug-log',
className: 'debug-log modal', className: 'debug-log modal',
initialize: function() { initialize() {
this.render(); this.render();
this.$('textarea').val(i18n('loading')); this.$('textarea').val(i18n('loading'));
window.log.fetch().then(function(text) { window.log.fetch().then((text) => {
this.$('textarea').val(text); this.$('textarea').val(text);
}.bind(this)); });
}, },
events: { events: {
'click .submit': 'submit', 'click .submit': 'submit',
'click .close': 'close' 'click .close': 'close',
}, },
render_attributes: { render_attributes: {
title: i18n('submitDebugLog'), title: i18n('submitDebugLog'),
cancel: i18n('cancel'), cancel: i18n('cancel'),
submit: i18n('submit'), submit: i18n('submit'),
close: i18n('gotIt'), close: i18n('gotIt'),
debugLogExplanation: i18n('debugLogExplanation') debugLogExplanation: i18n('debugLogExplanation'),
}, },
close: function(e) { close(e) {
e.preventDefault(); e.preventDefault();
this.remove(); this.remove();
}, },
submit: function(e) { submit(e) {
e.preventDefault(); e.preventDefault();
var text = this.$('textarea').val(); const text = this.$('textarea').val();
if (text.length === 0) { if (text.length === 0) {
return; return;
} }
log.publish(text).then(function(url) { log.publish(text).then((url) => {
var view = new Whisper.DebugLogLinkView({ const view = new Whisper.DebugLogLinkView({
url: url, url,
el: this.$('.result') el: this.$('.result'),
}); });
this.$('.loading').removeClass('loading'); this.$('.loading').removeClass('loading');
view.render(); view.render();
this.$('.link').focus().select(); this.$('.link').focus().select();
}.bind(this)); });
this.$('.buttons, textarea').remove(); this.$('.buttons, textarea').remove();
this.$('.result').addClass('loading'); this.$('.result').addClass('loading');
} },
}); });
}());
})();

Loading…
Cancel
Save