Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
🐛 fix PSM throbber bugs (#777)
Browse files Browse the repository at this point in the history
closes TryGhost/Ghost#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
  • Loading branch information
kevinansfield authored and aileen committed Jul 10, 2017
1 parent 643c45b commit 8aaf7f3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
9 changes: 8 additions & 1 deletion app/components/gh-post-settings-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions app/components/gh-tour-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion app/services/tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions app/templates/components/gh-post-settings-menu.hbs
Original file line number Diff line number Diff line change
@@ -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"}}
<div id="entry-controls">
<div class="{{if isViewingSubview 'settings-menu-pane-out-left' 'settings-menu-pane-in'}} settings-menu settings-menu-pane">
<div class="settings-menu-header">
Expand Down Expand Up @@ -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"
}}

Expand Down

0 comments on commit 8aaf7f3

Please sign in to comment.