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:
parent
355259c157
commit
acb83f2549
3 changed files with 12 additions and 21 deletions
|
@ -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);
|
||||
},
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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*/ ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue