From 15967214684aaa38b818ec436493fc8596fc2204 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Mon, 10 Jul 2017 13:15:20 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20PSM=20throbber=20bugs=20(#?= =?UTF-8?q?777)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes https://github.com/TryGhost/Ghost/issues/8611 - fix positioning of "static page" throbber - fix PSM throbbers re-appearing after PSM close/open (need to use `pushObject` instead of `push` so that it's KVO compliant and the `_activeThrobbers` CP is updated) - fix order of `willDestroyElement` so that we don't attempt to use `get` after the component is destroyed - fix issue in Chrome that was preventing the Meta Data link from sliding the PSM panels --- ghost/admin/app/components/gh-post-settings-menu.js | 9 ++++++++- ghost/admin/app/components/gh-tour-item.js | 4 ++-- ghost/admin/app/services/tour.js | 2 +- .../app/templates/components/gh-post-settings-menu.hbs | 4 ++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ghost/admin/app/components/gh-post-settings-menu.js b/ghost/admin/app/components/gh-post-settings-menu.js index 05ab53bb10..98ba07c667 100644 --- a/ghost/admin/app/components/gh-post-settings-menu.js +++ b/ghost/admin/app/components/gh-post-settings-menu.js @@ -6,6 +6,7 @@ import computed, {alias} from 'ember-computed'; import formatMarkdown from 'ghost-admin/utils/format-markdown'; import injectService from 'ember-service/inject'; import moment from 'moment'; +import run from 'ember-runloop'; import {guidFor} from 'ember-metal/utils'; import {htmlSafe} from 'ember-string'; import {invokeAction} from 'ember-invoke-action'; @@ -155,7 +156,13 @@ export default Component.extend(SettingsMenuMixin, { actions: { showSubview() { this._super(...arguments); - this.set('_showThrobbers', false); + + // Chrome appears to have an animation bug that cancels the slide + // transition unless there's a delay between the animation starting + // and the throbbers being removed + run.later(this, function () { + this.set('_showThrobbers', false); + }, 50); }, closeSubview() { diff --git a/ghost/admin/app/components/gh-tour-item.js b/ghost/admin/app/components/gh-tour-item.js index aa24b7c3c2..0f32a9fee2 100644 --- a/ghost/admin/app/components/gh-tour-item.js +++ b/ghost/admin/app/components/gh-tour-item.js @@ -121,9 +121,9 @@ const GhTourItemComponent = Component.extend({ }, willDestroyElement() { - this._super(...arguments); this.get('tour').off('optOut', this._handleOptOut); - this.get('tour').off('viewed', this._handleOptOut); + this.get('tour').off('viewed', this._handleViewed); + this._super(...arguments); }, _removeIfViewed(id) { diff --git a/ghost/admin/app/services/tour.js b/ghost/admin/app/services/tour.js index f72d42c67d..5984e2ba0a 100644 --- a/ghost/admin/app/services/tour.js +++ b/ghost/admin/app/services/tour.js @@ -113,7 +113,7 @@ export default Service.extend(Evented, { let viewed = this.get('viewed'); if (!viewed.includes(id)) { - this.get('viewed').push(id); + viewed.pushObject(id); this.trigger('viewed', id); return this.syncViewed(); } else { diff --git a/ghost/admin/app/templates/components/gh-post-settings-menu.hbs b/ghost/admin/app/templates/components/gh-post-settings-menu.hbs index bacffa4402..b3114aebdb 100644 --- a/ghost/admin/app/templates/components/gh-post-settings-menu.hbs +++ b/ghost/admin/app/templates/components/gh-post-settings-menu.hbs @@ -1,4 +1,4 @@ -{{#gh-tabs-manager selected="showSubview" id="entry-controls" class="settings-menu-container"}} +{{#gh-tabs-manager selected=(action "showSubview") id="entry-controls" class="settings-menu-container"}}
@@ -173,7 +173,7 @@ {{gh-tour-item "static-post" target="label[for='static-page'] p" throbberAttachment="middle middle" - throbberOffset="0px 75px" + throbberOffset="0px 33px" popoverTriangleClass="bottom-right" }}