Skip to content

Commit

Permalink
BUG: Only initialize a PlateViewer() on "create"
Browse files Browse the repository at this point in the history
Closes biocore#567, and addresses one of the two "warts" needed before my
fork can be merged back in (that will take care of biocore#354)
  • Loading branch information
fedarko committed Aug 17, 2019
1 parent 9e46960 commit 5a3fcd1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
1 change: 0 additions & 1 deletion labcontrol/gui/static/js/plate.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ function change_plate_configuration() {
} else {
// reset the container before updating the grid configuration
$('#plate-map-div').empty().height(0);
pv = new PlateViewer('plate-map-div', undefined, undefined, $opt.attr('pm-data-rows'), $opt.attr('pm-data-cols'));
// Enable the plate create button now that a plate config is selected
$('#createPlateBtn').prop('disabled', false);
}
Expand Down
8 changes: 0 additions & 8 deletions labcontrol/gui/static/js/plateViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,6 @@ PlateViewer.prototype.initialize = function (rows, cols) {
// don't select the active cell, otherwise cell navigation won't work
this.grid.setSelectionModel(new Slick.CellSelectionModel({selectActiveCell: false}));

// TODO: This function is called twice every time an event happens, and that
// is because this binding is applied twice (because this initialize()
// function is called twice). This is likely worth addressing -- there are
// multiple ways to circumvent this -- but I'm not sure what would be best.
// Idea 1: add this binding at the bottom of the plate HTML template
// Idea 2: add logic to detect if this binding already exists (buggy?)
// Idea 3: ignore this, and just accept that the callback will be called
// twice (...is this intended?)
$('#multiSelectCheckbox').on('change', function() {
// In this callback function, "this" is the m.s. checkbox's <input> element
// "that" is defined as this (see the start of this function), which lets
Expand Down

0 comments on commit 5a3fcd1

Please sign in to comment.