MCPcopy Create free account
hub / github.com/caike/jQuery-Simple-Timer / toolbarChanged

Function toolbarChanged

tests/qunit-2.9.2.js:4723–4792  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4721 // Handle "click" events on toolbar checkboxes and "change" for select menus.
4722 // Updates the URL with the new state of `config.urlConfig` values.
4723 function toolbarChanged() {
4724 var updatedUrl,
4725 value,
4726 tests,
4727 field = this,
4728 params = {};
4729
4730 // Detect if field is a select menu or a checkbox
4731 if ("selectedIndex" in field) {
4732 value = field.options[field.selectedIndex].value || undefined;
4733 } else {
4734 value = field.checked ? field.defaultValue || true : undefined;
4735 }
4736
4737 params[field.name] = value;
4738 updatedUrl = setUrl(params);
4739
4740 // Check if we can apply the change without a page refresh
4741 if ("hidepassed" === field.name && "replaceState" in window$1.history) {
4742 QUnit.urlParams[field.name] = value;
4743 config[field.name] = value || false;
4744 tests = id("qunit-tests");
4745 if (tests) {
4746 var length = tests.children.length;
4747 var children = tests.children;
4748
4749 if (field.checked) {
4750 for (var i = 0; i < length; i++) {
4751 var test = children[i];
4752
4753 if (test && test.className.indexOf("pass") > -1) {
4754 hiddenTests.push(test);
4755 }
4756 }
4757
4758 var _iteratorNormalCompletion = true;
4759 var _didIteratorError = false;
4760 var _iteratorError = undefined;
4761
4762 try {
4763 for (var _iterator = hiddenTests[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
4764 var hiddenTest = _step.value;
4765
4766 tests.removeChild(hiddenTest);
4767 }
4768 } catch (err) {
4769 _didIteratorError = true;
4770 _iteratorError = err;
4771 } finally {
4772 try {
4773 if (!_iteratorNormalCompletion && _iterator.return) {
4774 _iterator.return();
4775 }
4776 } finally {
4777 if (_didIteratorError) {
4778 throw _iteratorError;
4779 }
4780 }

Callers

nothing calls this directly

Calls 2

setUrlFunction · 0.85
idFunction · 0.85

Tested by

no test coverage detected