mirror of
https://github.com/documize/community.git
synced 2025-08-03 20:45: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();
|
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) {
|
onDocumentPageAdded(pageId) {
|
||||||
this.send('onEntryClick', pageId);
|
this.send('onEntryClick', pageId);
|
||||||
},
|
},
|
||||||
|
|
|
@ -24,13 +24,18 @@ export default Ember.Component.extend(NotifierMixin, {
|
||||||
this.setupImport();
|
this.setupImport();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
willDestroyElement() {
|
||||||
|
if (is.not.null(this.get('drop'))) {
|
||||||
|
this.get('drop').destroy();
|
||||||
|
this.set('drop', null);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
setupImport() {
|
setupImport() {
|
||||||
// already done init?
|
// already done init?
|
||||||
if (is.not.null(this.get('drop'))) {
|
if (is.not.null(this.get('drop'))) {
|
||||||
if (is.not.null(this.get('drop'))) {
|
this.get('drop').destroy();
|
||||||
this.get('drop').destroy();
|
this.set('drop', null);
|
||||||
this.set('drop', null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let self = this;
|
let self = this;
|
||||||
|
|
|
@ -12,12 +12,13 @@
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin';
|
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin';
|
||||||
import netUtil from '../utils/net';
|
import netUtil from '../utils/net';
|
||||||
|
import TooltipMixin from '../mixins/tooltip';
|
||||||
|
|
||||||
const {
|
const {
|
||||||
inject: { service }
|
inject: { service }
|
||||||
} = Ember;
|
} = Ember;
|
||||||
|
|
||||||
export default Ember.Route.extend(ApplicationRouteMixin, {
|
export default Ember.Route.extend(ApplicationRouteMixin, TooltipMixin, {
|
||||||
appMeta: service(),
|
appMeta: service(),
|
||||||
session: service(),
|
session: service(),
|
||||||
|
|
||||||
|
@ -34,6 +35,7 @@ export default Ember.Route.extend(ApplicationRouteMixin, {
|
||||||
actions: {
|
actions: {
|
||||||
willTransition: function( /*transition*/ ) {
|
willTransition: function( /*transition*/ ) {
|
||||||
Mousetrap.reset();
|
Mousetrap.reset();
|
||||||
|
this.destroyTooltips();
|
||||||
},
|
},
|
||||||
|
|
||||||
error(error /*, transition*/ ) {
|
error(error /*, transition*/ ) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue