genoverse 4.0.2 → 4.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genoverse",
3
- "version": "4.0.2",
3
+ "version": "4.0.3",
4
4
  "description": "Genoverse is a portable, customizable, back-end independent JavaScript and HTML5 based genome browser which allows the user to explore data in a dynamic and interactive manner.",
5
5
  "main": "src/js/Genoverse.js",
6
6
  "directories": {
@@ -146,17 +146,20 @@ const Genoverse = Base.extend({
146
146
  this.loadedPlugins[plugin.name] = true;
147
147
  };
148
148
 
149
- const pluginImports = Object.keys(pluginsByName).map(pluginName => import(`./plugins/${pluginName}`).then(
150
- (imported) => {
151
- initializePlugin({
152
- name : pluginName,
153
- conf : pluginsByName[pluginName].conf,
154
- exports : imported.default,
155
- });
156
- }
157
- ));
149
+ const pluginImports = Object.keys(pluginsByName).reduce(
150
+ (ready, pluginName) => ready.then(
151
+ () => import(`./plugins/${pluginName}`).then(
152
+ imported => initializePlugin({
153
+ name : pluginName,
154
+ conf : pluginsByName[pluginName].conf,
155
+ exports : imported.default,
156
+ })
157
+ )
158
+ ),
159
+ this.jQuery.Deferred().resolve()
160
+ );
158
161
 
159
- return this.jQuery.when(...pluginImports);
162
+ return this.jQuery.when(pluginImports);
160
163
  },
161
164
 
162
165
  init: function () {
@@ -543,7 +546,7 @@ const Genoverse = Base.extend({
543
546
  onTracks: function (func, ...args) {
544
547
  this.tracks.forEach(
545
548
  (track) => {
546
- if (track.disabled) {
549
+ if (track.disabled || !track._interface) { // if track._interface is undefined, the track has not been fully initialized yet
547
550
  return;
548
551
  }
549
552
 
@@ -1,13 +1,13 @@
1
- import './controlPanel';
1
+ import controlPanel from './controlPanel';
2
2
 
3
3
  const plugin = function () {
4
4
  this.controls.push({
5
- icon : '<i class="fas fa-map-marker-alt"></i>',
6
- 'class' : 'gv-button-large',
7
- name : `Reset focus to ${this.focusRegion && this.focusRegion.name ? this.focusRegion.name : `${this.chr}:${this.start}-${this.end}`}`,
8
- action : (browser) => { browser.moveTo(browser.focusRegion.chr, browser.focusRegion.start, browser.focusRegion.end, true); },
9
- init : (browser) => { browser.focusRegion = browser.focusRegion || { chr: browser.chr, start: browser.start, end: browser.end }; },
5
+ icon : '<i class="fas fa-map-marker-alt"></i>',
6
+ class : 'gv-button-large',
7
+ name : `Reset focus to ${this.focusRegion && this.focusRegion.name ? this.focusRegion.name : `${this.chr}:${this.start}-${this.end}`}`,
8
+ action : (browser) => { browser.moveTo(browser.focusRegion.chr, browser.focusRegion.start, browser.focusRegion.end, true); },
9
+ init : (browser) => { browser.focusRegion = browser.focusRegion || { chr: browser.chr, start: browser.start, end: browser.end }; },
10
10
  });
11
11
  };
12
12
 
13
- export default { focusRegion: plugin };
13
+ export default { focusRegion: plugin, requires: controlPanel };