Skip to content

Commit

Permalink
Use simplified referenceFrame object locuschange event.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinso committed Jan 2, 2019
1 parent df50511 commit afbd522
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 81 deletions.
6 changes: 2 additions & 4 deletions doc/events.html
Expand Up @@ -42,8 +42,6 @@ <h2>IGV.js Example - Events</h2>
<dl class="dl-horizontal">
<dt>referenceFrame</dt>
<dd>{object} frame state</dd>
<dt>label</dt>
<dd>{string} human-readable coordinates</dd>
</dl>
</div>
</td>
Expand Down Expand Up @@ -113,8 +111,8 @@ <h4 class="page-header">Subscribe to an Event</h4>

var browser = igv.createBrowser(div, options);

var onLocusChange = function (referenceFrame, label) {
alert("Locus changed to: " + label);
var onLocusChange = function (referenceFrame) {
alert("Locus changed to: " + referenceFrame.label);
};

browser.on("locuschange", onLocusChange);
Expand Down
4 changes: 2 additions & 2 deletions examples/event-example.html
Expand Up @@ -80,8 +80,8 @@ <h3>Try it out:</h3>
.then(function (browser) {
console.log("Created IGV browser");

browser.on('locuschange', function (referenceFrame, label) {
window.location.replace(HASH_PREFIX + label);
browser.on('locuschange', function (referenceFrame) {
window.location.replace(HASH_PREFIX + referenceFrame.label);
});
});

Expand Down
2 changes: 1 addition & 1 deletion js/browser.js
Expand Up @@ -1081,7 +1081,7 @@ var igv = (function (igv) {
this.$searchInput.val(str);
}

this.fireEvent('locuschange', [referenceFrame, str]);
this.fireEvent('locuschange', [{chr: referenceFrame.chrName, start: ss, end: ee, label: str}]);
}

} else {
Expand Down
144 changes: 72 additions & 72 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -37,8 +37,8 @@
},
"dependencies": {},
"devDependencies": {
"@babel/core": "^7.2.0",
"@babel/preset-env": "^7.2.0",
"@babel/core": "^7.2.2",
"@babel/preset-env": "^7.2.3",
"babel-plugin-transform-remove-console": "^6.9.4",
"grunt": "^1.0.3",
"grunt-babel": "^8.0.0",
Expand Down

0 comments on commit afbd522

Please sign in to comment.