Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
gorj-tessella committed Nov 12, 2020
2 parents 67d1711 + 15b09e3 commit f7ff097
Showing 5 changed files with 31 additions and 25 deletions.
26 changes: 15 additions & 11 deletions dist/js/plate-map.js
Original file line number Diff line number Diff line change
@@ -1244,19 +1244,23 @@ var plateMapWidget = plateMapWidget || {};
field.defaultUnit = null;
var newUnits = [];
var selected = null;
field.defaultUnit = field.units[0];
newUnits = field.units.map(function (curUnit) {
var cleanUnit = {
id: curUnit,
text: curUnit
};

if (curUnit === field.defaultUnit) {
selected = curUnit;
}
if (field.units && field.units.length) {
field.defaultUnit = field.units[0];
newUnits = field.units.map(function (curUnit) {
var cleanUnit = {
id: curUnit,
text: curUnit
};

if (curUnit === field.defaultUnit) {
selected = curUnit;
}

return cleanUnit;
});
}

return cleanUnit;
});
select2setData(unitInput, newUnits, selected);
};

2 changes: 1 addition & 1 deletion dist/js/plate-map.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/plate-map.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plate-map",
"version": "2.0.4",
"version": "2.0.5",
"description": "JavaScript Plate Layout is an open source tool developed collaboratively by [Chai Biotechnologies](www.chaibio.com) and [New England Biolabs](www.neb.com) for visualizing and editing the layout of scientific assay plates.",
"scripts": {
"build.dist": "gulp build.dist",
24 changes: 13 additions & 11 deletions src/js/create-field.js
Original file line number Diff line number Diff line change
@@ -213,17 +213,19 @@ var plateMapWidget = plateMapWidget || {};

let newUnits = [];
let selected = null;
field.defaultUnit = field.units[0];
newUnits = field.units.map(function(curUnit) {
let cleanUnit = {
id: curUnit,
text: curUnit
};
if (curUnit === field.defaultUnit) {
selected = curUnit;
}
return cleanUnit;
});
if (field.units && field.units.length) {
field.defaultUnit = field.units[0];
newUnits = field.units.map(function (curUnit) {
let cleanUnit = {
id: curUnit,
text: curUnit
};
if (curUnit === field.defaultUnit) {
selected = curUnit;
}
return cleanUnit;
});
}

select2setData(unitInput, newUnits, selected);
};

0 comments on commit f7ff097

Please sign in to comment.