Skip to content

Commit

Permalink
Merge pull request #553 from camicroscope/develop
Browse files Browse the repository at this point in the history
For 3.9.9
  • Loading branch information
birm committed Nov 8, 2021
2 parents 6337bda + acd80c2 commit 0365e1f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions apps/viewer/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ function initCore() {
slideQuery.id = $D.params.slideId;
slideQuery.name = $D.params.slide;
slideQuery.location = $D.params.location;
slideQuery.collection = $D.params.collection;
opt.addRulerCallback = onAddRuler;
opt.deleteRulerCallback = onDeleteRuler;
$CAMIC = new CaMic('main_viewer', slideQuery, opt);
Expand Down
3 changes: 2 additions & 1 deletion apps/viewer/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -418,12 +418,13 @@
$D.params.collection
)
) {
let STORE = new Store();
let STORE = new Store('../../data/');
STORE.findSlide(
$D.params.slide,
$D.params.study,
$D.params.specimen,
$D.params.location,
null,
$D.params.collection
)
.then(x => {
Expand Down
2 changes: 1 addition & 1 deletion common/PathdbMods.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function PathDbMods() {
}
console.warn("{PathDB mods enabled}")
Store.prototype.default_findSlide = Store.prototype.findSlide;
Store.prototype.findSlide = function(slide, specimen, study, location, collection) {
Store.prototype.findSlide = function(slide, specimen, study, location, q, collection) {
var url = `/idlookup/${collection}/${study}/${specimen}/${slide}?_format=json`
return fetch(url, {
mode: "cors",
Expand Down
2 changes: 1 addition & 1 deletion core/CaMic.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class CaMic {
} else {
slidePromise = this.store.findSlide(this.slideQuery.name,
this.slideQuery.study, this.slideQuery.specimen,
this.slideQuery.location);
this.slideQuery.location, this.slideQuery.collection);
}
slidePromise
.then((x)=>{
Expand Down
8 changes: 4 additions & 4 deletions core/Store.js
Original file line number Diff line number Diff line change
Expand Up @@ -634,15 +634,15 @@ class Store {
* @param {string} [q] - override query - ignores all other params if set
* @return {promise} - promise which resolves with data
**/
findSlide(slide, specimen, study, location, q) {
let query;
findSlide(name, specimen, study, location, q) {
let query = {};
const suffix = 'Slide/find';
const url = this.base + suffix;
if (q) {
query = q;
} else {
if (slide) {
query.slide = slide;
if (name) {
query.name = name;
}
if (study) {
query.study = study;
Expand Down

0 comments on commit 0365e1f

Please sign in to comment.