@@ -186,7 +186,7 @@ function populateBomHeader() {
186
186
var td = document . createElement ( "TH" ) ;
187
187
td . classList . add ( "numCol" ) ;
188
188
tr . appendChild ( td ) ;
189
- checkboxes = bomCheckboxes . split ( "," ) ;
189
+ checkboxes = bomCheckboxes . split ( "," ) . filter ( ( e ) => e ) ;
190
190
for ( var checkbox of checkboxes ) {
191
191
if ( checkbox ) {
192
192
td = document . createElement ( "TH" ) ;
@@ -522,6 +522,23 @@ function toggleBomCheckbox(bomrowid, checkboxnum) {
522
522
checkbox . onchange ( ) ;
523
523
}
524
524
525
+ function checkBomCheckbox ( bomrowid , checkboxname ) {
526
+ var checkboxnum = 0 ;
527
+ while ( checkboxnum < checkboxes . length &&
528
+ checkboxes [ checkboxnum ] . toLowerCase ( ) != checkboxname . toLowerCase ( ) ) {
529
+ checkboxnum ++ ;
530
+ }
531
+ if ( ! bomrowid || checkboxnum > checkboxes . length ) {
532
+ return ;
533
+ }
534
+ var bomrow = document . getElementById ( bomrowid ) ;
535
+ var checkbox = bomrow . childNodes [ checkboxnum + 1 ] . childNodes [ 0 ] ;
536
+ checkbox . checked = true ;
537
+ checkbox . indeterminate = false ;
538
+ checkbox . onchange ( ) ;
539
+ }
540
+
541
+
525
542
function removeGutterNode ( node ) {
526
543
for ( var i = 0 ; i < node . childNodes . length ; i ++ ) {
527
544
if ( node . childNodes [ i ] . classList &&
@@ -545,6 +562,13 @@ function setBomCheckboxes(value) {
545
562
546
563
document . onkeydown = function ( e ) {
547
564
switch ( e . key ) {
565
+ case "n" :
566
+ if ( currentHighlightedRowId !== null ) {
567
+ checkBomCheckbox ( currentHighlightedRowId , "placed" ) ;
568
+ highlightNextRow ( ) ;
569
+ e . preventDefault ( ) ;
570
+ }
571
+ break ;
548
572
case "ArrowUp" :
549
573
highlightPreviousRow ( ) ;
550
574
e . preventDefault ( ) ;
0 commit comments