Skip to content

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

moving checks in the api functions

uggrock2bbb673cefd9
diff --git a/data/js/core.ui.js b/data/js/core.ui.js
index 7c48065ef..b327a28a3 100644
--- a/data/js/core.ui.js
+++ b/data/js/core.ui.js
@@ -615,7 +615,17 @@ define(function(require, exports) {
}
function showFileRenameDialog(filePath) {
+ if(!filePath) {
+ filePath = TSCORE.selectedFiles[0];
+ }
+ if(!filePath) {
+ TSCORE.showAlertDialog("Please select a file first.", "Renaming not possible!");
+ return false;
+ }
$('#renamedFileName').attr('filepath', filePath);
+ //$('#renamedFileName').on("keydown", function(e) {
+ // e.preventDefault();
+ //})
$('#renamedFileName').val(TSCORE.TagUtils.extractFileName(filePath));
$('#formFileRename').validator();
$('#formFileRename').submit(function(e) {