Follow changes in the theme name immediately in static theme wizard
This commit is contained in:
Родитель
e61a887248
Коммит
b95610846f
|
@ -48,6 +48,10 @@ $(document).ready(function() {
|
||||||
|
|
||||||
function updateManifest() {
|
function updateManifest() {
|
||||||
textarea = $wizard.find('#manifest').val(generateManifest());
|
textarea = $wizard.find('#manifest').val(generateManifest());
|
||||||
|
toggleSubmitIfNeeded();
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleSubmitIfNeeded() {
|
||||||
$wizard.find('button.upload').attr('disabled', ! required_fields_present());
|
$wizard.find('button.upload').attr('disabled', ! required_fields_present());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,9 +124,16 @@ $(document).ready(function() {
|
||||||
updateManifest();
|
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');
|
$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('change', '#theme-name', updateManifest);
|
||||||
|
|
||||||
$wizard.on('click', 'button.upload', _pd(function(event) {
|
$wizard.on('click', 'button.upload', _pd(function(event) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче