MCPcopy Create free account
hub / github.com/MALSync/MALSync / calcSelectWidth

Method calcSelectWidth

src/pages-sync/syncPage.ts:1149–1166  ·  view source on GitHub ↗
(selectors)

Source from the content-addressed store, hash-verified

1147 }
1148
1149 private calcSelectWidth(selectors) {
1150 selectors.each(function (index, selector) {
1151 const text = j.$(selector).find('option:selected').text();
1152 const aux = j.$('<select style="width: auto;"/>').append(j.html(`<option>${text}</option>`));
1153 const width = aux.width() || 0;
1154
1155 if (width) {
1156 j.$('#malp').append(
1157 // @ts-expect-error
1158 // TODO --fix this line doesn't make sense
1159 // .html will return [object Object] 'cause aux is JQuery<HTMLElement>
1160 j.html(aux),
1161 );
1162 j.$(selector).width(width + 5);
1163 aux.remove();
1164 }
1165 });
1166 }
1167
1168 private async buttonclick() {
1169 this.singleObj.setEpisode(j.$('#malEpisodes').val());

Callers 2

fillUIMethod · 0.95
loadUIMethod · 0.80

Calls 1

removeMethod · 0.80

Tested by

no test coverage detected