Skip to content

TagSpaces is an offline, open source, document manager with tagging support

focusing the first edit box automatically after opening of the dialogs

Ilian4b290baa0b91
diff --git a/data/js/tags.ui.js b/data/js/tags.ui.js
index 5f16a98d4..5faf85d83 100644
--- a/data/js/tags.ui.js
+++ b/data/js/tags.ui.js
@@ -437,18 +437,33 @@
}
function showDialogTagCreate() {
- $( "#newTagTitle" ).val("");
- $( '#dialogTagCreate' ).modal({backdrop: 'static',show: true});
+ $( "#newTagTitle" ).val("");
+
+ $('#dialogTagCreate').on('shown.bs.modal', function () {
+ $('#newTagTitle').focus();
+ })
+
+ $( '#dialogTagCreate' ).modal({backdrop: 'static',show: true});
}
function showDialogEditTagGroup() {
- $( "#tagGroupName" ).val(TSCORE.selectedTagData.title);
- $( '#dialogEditTagGroup' ).modal({backdrop: 'static',show: true});
+ $( "#tagGroupName" ).val(TSCORE.selectedTagData.title);
+
+ $('#dialogEditTagGroup').on('shown.bs.modal', function () {
+ $('#tagGroupName').focus();
+ })
+
+ $( '#dialogEditTagGroup' ).modal({backdrop: 'static',show: true});
}
function showDialogTagGroupCreate() {
- $( "#newTagGroupName" ).val("");
- $( '#dialogTagGroupCreate' ).modal({backdrop: 'static',show: true});
+ $( "#newTagGroupName" ).val("");
+
+ $('#dialogTagGroupCreate').on('shown.bs.modal', function () {
+ $('#newTagGroupName').focus();
+ })
+
+ $( '#dialogTagGroupCreate' ).modal({backdrop: 'static',show: true});
}
function showTagEditInTreeDialog() {
@@ -473,6 +488,11 @@
} else {
$tagTextColor.simplecolorpicker('selectColor', TSCORE.selectedTagData.textcolor);
}
+
+ $('#dialogEditInTreeTag').on('shown.bs.modal', function () {
+ $('#tagInTreeName').focus();
+ })
+
$( '#dialogEditInTreeTag' ).modal({backdrop: 'static',show: true});
}
@@ -494,6 +514,10 @@
selectOnBlur: true
});
+ $('#dialogAddTags').on('shown.bs.modal', function () {
+ $('.select2-input').focus();
+ })
+
$( '#dialogAddTags' ).modal({backdrop: 'static',show: true});
}