Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbrent committed Mar 17, 2022
2 parents 5bd9977 + 9c34521 commit 0e2fb5e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "genoverse",
"version": "4.0.2",
"version": "4.0.3",
"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.",
"main": "src/js/Genoverse.js",
"directories": {
Expand Down
25 changes: 14 additions & 11 deletions src/js/Genoverse.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,20 @@ const Genoverse = Base.extend({
this.loadedPlugins[plugin.name] = true;
};

const pluginImports = Object.keys(pluginsByName).map(pluginName => import(`./plugins/${pluginName}`).then(
(imported) => {
initializePlugin({
name : pluginName,
conf : pluginsByName[pluginName].conf,
exports : imported.default,
});
}
));
const pluginImports = Object.keys(pluginsByName).reduce(
(ready, pluginName) => ready.then(
() => import(`./plugins/${pluginName}`).then(
imported => initializePlugin({
name : pluginName,
conf : pluginsByName[pluginName].conf,
exports : imported.default,
})
)
),
this.jQuery.Deferred().resolve()
);

return this.jQuery.when(...pluginImports);
return this.jQuery.when(pluginImports);
},

init: function () {
Expand Down Expand Up @@ -543,7 +546,7 @@ const Genoverse = Base.extend({
onTracks: function (func, ...args) {
this.tracks.forEach(
(track) => {
if (track.disabled) {
if (track.disabled || !track._interface) { // if track._interface is undefined, the track has not been fully initialized yet
return;
}

Expand Down
14 changes: 7 additions & 7 deletions src/js/plugins/focusRegion.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import './controlPanel';
import controlPanel from './controlPanel';

const plugin = function () {
this.controls.push({
icon : '<i class="fas fa-map-marker-alt"></i>',
'class' : 'gv-button-large',
name : `Reset focus to ${this.focusRegion && this.focusRegion.name ? this.focusRegion.name : `${this.chr}:${this.start}-${this.end}`}`,
action : (browser) => { browser.moveTo(browser.focusRegion.chr, browser.focusRegion.start, browser.focusRegion.end, true); },
init : (browser) => { browser.focusRegion = browser.focusRegion || { chr: browser.chr, start: browser.start, end: browser.end }; },
icon : '<i class="fas fa-map-marker-alt"></i>',
class : 'gv-button-large',
name : `Reset focus to ${this.focusRegion && this.focusRegion.name ? this.focusRegion.name : `${this.chr}:${this.start}-${this.end}`}`,
action : (browser) => { browser.moveTo(browser.focusRegion.chr, browser.focusRegion.start, browser.focusRegion.end, true); },
init : (browser) => { browser.focusRegion = browser.focusRegion || { chr: browser.chr, start: browser.start, end: browser.end }; },
});
};

export default { focusRegion: plugin };
export default { focusRegion: plugin, requires: controlPanel };

0 comments on commit 0e2fb5e

Please sign in to comment.