removed some view methods

This commit is contained in:
antelle 2019-09-15 12:12:00 +02:00
parent 5cd19cee56
commit bc808889a1
5 changed files with 7 additions and 25 deletions

View File

@ -33,7 +33,7 @@ const Scrollable = {
// }
if (this.scroll) {
this.scroll.update();
this.requestAnimationFrame(function() {
requestAnimationFrame(() => {
if (this.scroll) {
this.scroll.update();
const barHeight = this.scrollerBar.height();

View File

@ -34,17 +34,7 @@ _.extend(Backbone.View.prototype, {
},
afterPaint(callback) {
this.requestAnimationFrame(function() {
this.requestAnimationFrame(callback);
});
},
setTimeout(callback) {
setTimeout(callback.bind(this), 0);
},
requestAnimationFrame(callback) {
requestAnimationFrame(callback.bind(this));
requestAnimationFrame(() => requestAnimationFrame(callback));
},
renderTemplate(model, replace) {
@ -94,10 +84,6 @@ _.extend(Backbone.View.prototype, {
});
this.views = {};
}
},
deferRender() {
_.defer(this.render.bind(this));
}
});

View File

@ -408,7 +408,7 @@ const DetailsView = Backbone.View.extend({
this.views.dropdownView.remove();
this.views.dropdownView = null;
} else {
this.setTimeout(function() {
setTimeout(() => {
const dropdownView = new DropdownView();
this.listenTo(dropdownView, 'cancel', this.toggleMoreOptions);
this.listenTo(dropdownView, 'select', this.moreOptionsSelect);

View File

@ -156,9 +156,7 @@ const FieldViewCustom = FieldViewText.extend({
if (this.labelInput) {
this.endEditTitle(this.labelInput.val());
}
this.setTimeout(function() {
this.input.focus();
});
setTimeout(() => this.input.focus());
}
});

View File

@ -55,11 +55,9 @@ const SettingsFileView = Backbone.View.extend({
appModel: null,
initialize() {
this.listenTo(
this.model,
'change:syncing change:syncError change:syncDate',
this.deferRender
);
this.listenTo(this.model, 'change:syncing change:syncError change:syncDate', () => {
setTimeout(() => this.render(), 0);
});
},
render() {