1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-02 20:15:26 +02:00

Cleaned up tooltip destroy in app.willTransition

This commit is contained in:
Harvey Kandola 2016-11-07 09:55:35 -08:00
parent 355259c157
commit acb83f2549
3 changed files with 12 additions and 21 deletions

View file

@ -52,22 +52,6 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
this.destroyTooltips();
},
// positionToc() {
// let s = $(".document-structure");
// let pos = s.position();
//
// $(window).scroll(_.throttle(function() {
// let windowpos = $(window).scrollTop();
// if (windowpos - 200 >= pos.top) {
// s.addClass("stuck-toc");
// s.css('width', s.parent().width());
// } else {
// s.removeClass("stuck-toc");
// s.css('width', 'auto');
// }
// }, 50));
// },
onDocumentPageAdded(pageId) {
this.send('onEntryClick', pageId);
},

View file

@ -24,13 +24,18 @@ export default Ember.Component.extend(NotifierMixin, {
this.setupImport();
},
willDestroyElement() {
if (is.not.null(this.get('drop'))) {
this.get('drop').destroy();
this.set('drop', null);
}
},
setupImport() {
// already done init?
if (is.not.null(this.get('drop'))) {
if (is.not.null(this.get('drop'))) {
this.get('drop').destroy();
this.set('drop', null);
}
this.get('drop').destroy();
this.set('drop', null);
}
let self = this;

View file

@ -12,12 +12,13 @@
import Ember from 'ember';
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin';
import netUtil from '../utils/net';
import TooltipMixin from '../mixins/tooltip';
const {
inject: { service }
} = Ember;
export default Ember.Route.extend(ApplicationRouteMixin, {
export default Ember.Route.extend(ApplicationRouteMixin, TooltipMixin, {
appMeta: service(),
session: service(),
@ -34,6 +35,7 @@ export default Ember.Route.extend(ApplicationRouteMixin, {
actions: {
willTransition: function( /*transition*/ ) {
Mousetrap.reset();
this.destroyTooltips();
},
error(error /*, transition*/ ) {