diff --git a/app/app/components/document/document-sidebar-toc.js b/app/app/components/document/document-sidebar-toc.js index 435ea341..a8380c7b 100644 --- a/app/app/components/document/document-sidebar-toc.js +++ b/app/app/components/document/document-sidebar-toc.js @@ -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); }, diff --git a/app/app/components/folder/start-document.js b/app/app/components/folder/start-document.js index b97b1c65..4524635d 100644 --- a/app/app/components/folder/start-document.js +++ b/app/app/components/folder/start-document.js @@ -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; diff --git a/app/app/routes/application.js b/app/app/routes/application.js index 6da5f655..0e531dc3 100644 --- a/app/app/routes/application.js +++ b/app/app/routes/application.js @@ -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*/ ) {