Follow changes in the theme name immediately in static theme wizard

This commit is contained in:
Mathieu Pillard 2018-07-26 12:53:23 +02:00
Родитель e61a887248
Коммит b95610846f
1 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -48,6 +48,10 @@ $(document).ready(function() {
function updateManifest() {
textarea = $wizard.find('#manifest').val(generateManifest());
toggleSubmitIfNeeded();
}
function toggleSubmitIfNeeded() {
$wizard.find('button.upload').attr('disabled', ! required_fields_present());
}
@ -120,9 +124,16 @@ $(document).ready(function() {
updateManifest();
}
});
/* force the pop-up panel ltr or the images end up in the wrong position. */
/* Force the pop-up panel ltr or the images end up in the wrong
position. */
$wizard.find('div.minicolors-panel').attr('dir', 'ltr');
/* The submit button availability needs to follow changes to the theme
name as soon as they happen, to react properly if it's modified but
the user hasn't focused something else yet */
$wizard.on('input', '#theme-name', toggleSubmitIfNeeded);
/* We update the full manifest when a proper change event is triggered,
the user has finished editing the name at this point. */
$wizard.on('change', '#theme-name', updateManifest);
$wizard.on('click', 'button.upload', _pd(function(event) {