MCPcopy
hub / github.com/dbolya/yolact / make_toggle

Function make_toggle

web/scripts/viewer.js:132–146  ·  view source on GitHub ↗
(name, setting)

Source from the content-addressed store, hash-verified

130 }
131
132 var make_toggle = function(name, setting) {
133 html += '<div class="setting" style="grid-template-columns: 1fr 0px 50px;">';
134 html += '<span class="setting_label">' + name + '</span>';
135 html += '<label class="switch">';
136 html += '<input type="checkbox" id="' + setting + '" class="setting_input"' + (settings[setting] ? 'checked' : '') + '>';
137 html += '<span class="slider round"></span>';
138 html += '</label></div>';
139 append_html();
140
141 $('input#' + setting).change(function (e) {
142 settings[setting] = $('input#' + setting).prop('checked');
143 save_settings();
144 render();
145 });
146 }
147
148
149 make_slider('Top K', 'top_k', 1, dets.length);

Callers 1

fill_controlsFunction · 0.85

Calls 4

append_htmlFunction · 0.85
$Function · 0.85
save_settingsFunction · 0.85
renderFunction · 0.70

Tested by

no test coverage detected