()
| 487 | return; |
| 488 | |
| 489 | function makeDisableInputs() { |
| 490 | var inputRecorderWrapper = makeInputRecorder(); |
| 491 | inputRecorderWrapper.setupInputId('__\0testHelper_disableInputs'); |
| 492 | var disableInputsWithRecordInputs = inputRecorderWrapper.inputRecorder.wrapUserInputListener({ |
| 493 | listener: disableInputs, |
| 494 | op: 'disableInputs' |
| 495 | }); |
| 496 | |
| 497 | /** |
| 498 | * @param {string|Array.<string>?} opt.groupId |
| 499 | * @param {string|Array.<string>?} opt.inputId |
| 500 | * @param {boolean} opt.recordInputs |
| 501 | */ |
| 502 | return function (opt) { |
| 503 | opt.recordInputs |
| 504 | ? disableInputsWithRecordInputs(opt) |
| 505 | : disableInputs(opt); |
| 506 | } |
| 507 | |
| 508 | function disableInputs(opt) { |
| 509 | assert(opt, '[disableInputs] requires parameters.'); |
| 510 | var groupId = opt.groupId; |
| 511 | var inputId = opt.inputId; |
| 512 | assert( |
| 513 | groupId != null || inputId != null, |
| 514 | '[disableInputs] requires `groupId` or/and `inputId`.' |
| 515 | ); |
| 516 | var inputIdList = []; |
| 517 | if (inputId != null) { |
| 518 | if (getType(inputId) !== 'array') { |
| 519 | inputId = [inputId]; |
| 520 | } |
| 521 | for (var idx = 0; idx < inputId.length; idx++) { |
| 522 | var id = inputId[idx]; |
| 523 | findInputCreatedAndCheck(id, {throw: true}); |
| 524 | inputIdList.push(id); |
| 525 | } |
| 526 | } |
| 527 | if (groupId != null) { |
| 528 | if (getType(groupId) !== 'array') { |
| 529 | groupId = [groupId]; |
| 530 | } |
| 531 | for (var idx = 0; idx < groupId.length; idx++) { |
| 532 | inputIdList = inputIdList.concat(retrieveAndVerifyGroup(groupId[idx]).idList); |
| 533 | } |
| 534 | } |
| 535 | var disabled = opt.disabled; |
| 536 | for (var idx = 0; idx < inputIdList.length; idx++) { |
| 537 | var id = inputIdList[idx]; |
| 538 | if (_inputsDict[id].disable) { |
| 539 | _inputsDict[id].disable({disabled: disabled}); |
| 540 | } |
| 541 | } |
| 542 | } |
| 543 | } |
| 544 | |
| 545 | /** |
| 546 | * @param {string} opt.action 'start' or 'stop'. |
no test coverage detected
searching dependent graphs…