FIX: Yet more linting fixes

This commit is contained in:
Robin Ward 2019-10-29 16:14:46 -04:00
parent 5ca60fcb6b
commit e5525d03b8
14 changed files with 14 additions and 55 deletions

View File

@ -52,9 +52,7 @@ export default Component.extend(
this.resumable.on("fileProgress", file => {
// update progress
later(() =>
this.set("progress", parseInt(file.progress() * 100, 10))
);
later(() => this.set("progress", parseInt(file.progress() * 100, 10)));
});
this.resumable.on("fileSuccess", file => {

View File

@ -58,9 +58,7 @@ export default Component.extend({
chooseMessage(message) {
const messageId = Ember.get(message, "id");
this.set("selectedTopicId", messageId);
next(() =>
$(`#choose-message-${messageId}`).prop("checked", "true")
);
next(() => $(`#choose-message-${messageId}`).prop("checked", "true"));
return false;
}
}

View File

@ -197,13 +197,7 @@ export default Component.extend({
this._initInputPreviewSync($input, $preview);
} else {
$input.on("scroll", () =>
throttle(
this,
this._syncEditorAndPreviewScroll,
$input,
$preview,
20
)
throttle(this, this._syncEditorAndPreviewScroll, $input, $preview, 20)
);
}

View File

@ -444,10 +444,7 @@ export default Component.extend({
if (filterInput) {
filterInput.value = v.term;
later(
() => filterInput.dispatchEvent(new Event("input")),
50
);
later(() => filterInput.dispatchEvent(new Event("input")), 50);
}
});

View File

@ -14,9 +14,7 @@ const DiscoveryTopicsListComponent = Component.extend(UrlRefresh, LoadMore, {
_readjustScrollPosition() {
const scrollTo = this.session.get("topicListScrollPosition");
if (scrollTo && scrollTo >= 0) {
schedule("afterRender", () =>
$(window).scrollTop(scrollTo + 1)
);
schedule("afterRender", () => $(window).scrollTop(scrollTo + 1));
} else {
scheduleOnce("afterRender", this, this.loadMoreUnlessFull);
}

View File

@ -92,10 +92,7 @@ export default Component.extend(
this._boundRerenderBuffer = bind(this, this.rerenderBuffer);
LogsNotice.current().addObserver("hidden", this._boundRerenderBuffer);
this._boundResetCurrentProp = bind(
this,
this._resetCurrentProp
);
this._boundResetCurrentProp = bind(this, this._resetCurrentProp);
$(this.element).on(
"click.global-notice",
".alert-logs-notice .close",

View File

@ -19,10 +19,7 @@ export default Component.extend({
@on("didInsertElement")
_registerListener() {
this._promptEventHandler = bind(
this,
this._handleInstallPromptEvent
);
this._promptEventHandler = bind(this, this._handleInstallPromptEvent);
window.addEventListener("beforeinstallprompt", this._promptEventHandler);
},

View File

@ -314,8 +314,7 @@ export default MountWidget.extend({
didInsertElement() {
this._super(...arguments);
const debouncedScroll = () =>
debounce(this, this._scrollTriggered, 10);
const debouncedScroll = () => debounce(this, this._scrollTriggered, 10);
this._previouslyNearby = {};

View File

@ -11,10 +11,7 @@ export default Component.extend({
hideForSession() {
this.session.set("hideSignupCta", true);
this.keyValueStore.setItem("anon-cta-hidden", new Date().getTime());
later(
() => this.session.set("showSignupCta", false),
20 * 1000
);
later(() => this.session.set("showSignupCta", false), 20 * 1000);
}
},

View File

@ -70,9 +70,7 @@ export default Component.extend(LoadMore, {
let scrollTo = this.session.get("topicListScrollPosition");
if (scrollTo && scrollTo >= 0) {
schedule("afterRender", () =>
$(window).scrollTop(scrollTo + 1)
);
schedule("afterRender", () => $(window).scrollTop(scrollTo + 1));
}
},

View File

@ -101,12 +101,7 @@ export default Component.extend({
const prevEvent = this.prevEvent;
if (prevEvent) {
scheduleOnce(
"afterRender",
this,
this._topicScrolled,
prevEvent
);
scheduleOnce("afterRender", this, this._topicScrolled, prevEvent);
} else {
scheduleOnce("afterRender", this, this._updateProgressBar);
}

View File

@ -87,11 +87,7 @@ export default Component.extend(
// TODO Sam: concerned this can cause a heavy rerender loop
if (!Ember.testing) {
this._delayedRerender = later(
this,
this.rerender,
rerenderDelay
);
this._delayedRerender = later(this, this.rerender, rerenderDelay);
}
}
},

View File

@ -95,10 +95,7 @@ function positioningWorkaround($fixedElement) {
if (!iOSWithVisualViewport()) {
fixedElement.style.height = oldHeight;
later(
() => $(fixedElement).removeClass("no-transition"),
500
);
later(() => $(fixedElement).removeClass("no-transition"), 500);
}
$(window).scrollTop(originalScrollTop);

View File

@ -135,9 +135,7 @@ const DiscoveryCategoriesRoute = DiscourseRoute.extend(OpenComposer, {
},
didTransition() {
next(() =>
this.controllerFor("application").set("showFooter", true)
);
next(() => this.controllerFor("application").set("showFooter", true));
return true;
}
}