Browse Source

Fix bug where input wouldn't always be focused

adaptive-webui-19844
Thomas Piccirello 6 years ago
parent
commit
2f33ecf37b
  1. 8
      src/webui/www/private/newcategory.html

8
src/webui/www/private/newcategory.html

@ -35,10 +35,7 @@
var uriCategoryName = safeTrim(new URI().getData('categoryName')); var uriCategoryName = safeTrim(new URI().getData('categoryName'));
var uriSavePath = safeTrim(new URI().getData('savePath')); var uriSavePath = safeTrim(new URI().getData('savePath'));
if (uriAction === "create") { if (uriAction === "edit") {
$('categoryName').focus();
}
else if (uriAction === "edit") {
if (!uriCategoryName) if (!uriCategoryName)
return false; return false;
@ -47,6 +44,9 @@
$('savePath').set('value', escapeHtml(uriSavePath)); $('savePath').set('value', escapeHtml(uriSavePath));
$('savePath').focus(); $('savePath').focus();
} }
else {
$('categoryName').focus();
}
$('categoryNameButton').addEvent('click', function(e) { $('categoryNameButton').addEvent('click', function(e) {
new Event(e).stop(); new Event(e).stop();

Loading…
Cancel
Save