1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-05-13 22:05:21 +02:00

fix: reset external lib selects value to default after selection

This commit is contained in:
Kushagra Gour 2017-06-08 01:31:24 +05:30
parent e4a2268275
commit 12fdbdd99f

View File

@ -1651,9 +1651,12 @@ runBtn, searchInput, consoleEl, consoleLogEl, logCountEl, fontStyleTag, fontStyl
addLibrarySelect.children[2].innerHTML = libOptions;
addLibrarySelect.addEventListener('change', function onSelectChange(e) {
var target = e.target;
if (!target.value) { return; }
$('#js-external-' + target.selectedOptions[0].dataset.type).value += '\n' + target.value;
trackEvent('ui', 'addLibrarySelect', target.selectedOptions[0].label);
onExternalLibChange();
// Reset the select to the default value
target.value = '';
});
externalJsTextarea.addEventListener('blur', onExternalLibChange);
externalCssTextarea.addEventListener('blur', onExternalLibChange);