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 => { this.resumable.on("fileProgress", file => {
// update progress // update progress
later(() => later(() => this.set("progress", parseInt(file.progress() * 100, 10)));
this.set("progress", parseInt(file.progress() * 100, 10))
);
}); });
this.resumable.on("fileSuccess", file => { this.resumable.on("fileSuccess", file => {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -101,12 +101,7 @@ export default Component.extend({
const prevEvent = this.prevEvent; const prevEvent = this.prevEvent;
if (prevEvent) { if (prevEvent) {
scheduleOnce( scheduleOnce("afterRender", this, this._topicScrolled, prevEvent);
"afterRender",
this,
this._topicScrolled,
prevEvent
);
} else { } else {
scheduleOnce("afterRender", this, this._updateProgressBar); 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 // TODO Sam: concerned this can cause a heavy rerender loop
if (!Ember.testing) { if (!Ember.testing) {
this._delayedRerender = later( this._delayedRerender = later(this, this.rerender, rerenderDelay);
this,
this.rerender,
rerenderDelay
);
} }
} }
}, },

View File

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

View File

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