Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { computed } from '@ember/object';
import Wormhole from 'ember-wormhole/components/ember-wormhole';
import layout from '../templates/components/x-favicon';
export default Wormhole.extend({
layout,
destinationElement: computed(function () {
return document.getElementsByTagName('head')[0];
})
});
import { computed } from '@ember/object';
import { A } from '@ember/array';
import Wormhole from 'ember-wormhole/components/ember-wormhole';
var titles = A([]);
export default Wormhole.extend({
init: function () {
this._super();
if (titles.length === 0) {
document.title = '';
}
titles.push(this);
},
destinationElement: computed(function () {
return document.getElementsByTagName('title')[0];
}),
willDestroyElement: function () {
titles.removeObject(this);
this._super.apply(this, arguments);
import { on } from '@ember/object/evented';
import EmberWormhole from 'ember-wormhole/components/ember-wormhole';
export default EmberWormhole.extend({
_storeSelf: on('didInsertElement', function () {
this.$().data('ember-wormhole', this);
}),
_removeSelf: on('willDestroyElement', function () {
this.$().removeData();
})
});
import WormholeComponent from 'ember-wormhole/components/ember-wormhole';
export default WormholeComponent.extend({
didInsertElement() {
this._super(...arguments);
let didInsert = this.getAttr('didInsert');
if (didInsert) {
didInsert();
}
},
willDestroyElement() {
this._super(...arguments);
let willRemove = this.getAttr('willRemove');
if (willRemove) {
willRemove();
}
}
});