MCPcopy Index your code
hub / github.com/philc/vimium / resetInputValue

Function resetInputValue

pages/options.js:107–115  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

105
106// Invoked when the user clicks the "reset" button next to an option's text field.
107function resetInputValue(event) {
108 const parentDiv = event.target.parentNode.parentNode;
109 console.assert(parentDiv?.tagName == "DIV", "Expected parent to be a div", event.target);
110 const input = parentDiv.querySelector("input") || parentDiv.querySelector("textarea");
111 const optionName = input.name;
112 const defaultValue = Settings.defaultOptions[optionName];
113 input.value = defaultValue;
114 event.preventDefault();
115}
116
117function setFormFromSettings(settings) {
118 for (const [optionName, optionType] of Object.entries(options)) {

Callers 1

initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected