Skip to content

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

fixing issue with the in place title editor

uggrock6744e8365c74
diff --git a/data/assets/components.css b/data/assets/components.css
index b33f8b13d..1cee78190 100644
--- a/data/assets/components.css
+++ b/data/assets/components.css
@@ -171,4 +171,30 @@ Licensed under MIT https://github.com/tobiasahlin/SpinKit/blob/master/LICENSE
box-shadow: none;
}
-/* End SELECT2 */
\ No newline at end of file
+/* End SELECT2 */
+
+/* bootstrap3xeditable class */
+.editable-inline {
+ margin-top: 5px;
+ width: 99% !important;
+}
+
+.editable-inline input {
+ font-size: 16px !important;
+}
+
+.editable-cancel {
+ margin-right: 5px;
+ margin-left: 0px !important;
+ min-width: 50px;
+}
+
+.editable-submit {
+ margin-left: 0px !important;
+ min-width: 50px;
+}
+
+.editableform .form-control {
+ width: 220px;
+}
+/* END bootstrap3xeditable class */
\ No newline at end of file
diff --git a/data/assets/core.css b/data/assets/core.css
index 5b13beb86..f5407c244 100644
--- a/data/assets/core.css
+++ b/data/assets/core.css
@@ -78,16 +78,14 @@
}
#fileTitle {
+ margin-top: 5px;
height: 30px;
- line-height: 2.2;
padding-right: 4px;
font-size: 16px;
font-weight: 300;
border: 0;
background-color: transparent;
color: #333333;
- max-width: 150px;
- z-index: 2;
white-space: nowrap;
}
@@ -96,16 +94,6 @@
background-color: rgb(210, 210, 210);
}
-/* bootstrap3xeditable class */
-.editable-inline {
- margin-top: 5px;
-}
-
-.editable-inline input {
- font-size: 16px !important;
-}
-/* END bootstrap3xeditable class */
-
#viewsRadio {
margin: 3px 3px 3px 0;
display: inline-block;
diff --git a/data/index.html b/data/index.html
index d3c54edc9..f56283039 100644
--- a/data/index.html
+++ b/data/index.html
@@ -305,8 +305,8 @@
<span class="pull-right label label-default keyShortcut">Alt+Enter</span></a></li>
</ul>
</div>
- <div class="flexMaxWidth">
- <a id="fileTitle"></a>
+ <div class="flexMaxWidth flexLayout">
+ <a id="fileTitle" class="flexMaxWidth"></a>
</div>
<button class="btn btn-link" data-i18n="[title]ns.common:closeFileTooltip;" id="closeOpenedFile">
&nbsp;<i class="fa fa-times fa-lg"></i>&nbsp;
diff --git a/data/js/fileopener.js b/data/js/fileopener.js
index c80ca6910..90bfb9178 100644
--- a/data/js/fileopener.js
+++ b/data/js/fileopener.js
@@ -17,8 +17,14 @@ define(function(require, exports, module) {
var _isFileChanged = false;
var _tsEditor;
var generatedTagButtons;
- // Backup cancel button <!--button type="button" class="btn editable-cancel"><i class="fa fa-times fa-lg"></i></button-->
- $.fn.editableform.buttons = '<button type="submit" class="btn btn-primary editable-submit"><i class="fa fa-check fa-lg"></i></button>';
+ $.fn.editableform.buttons = '<button type="submit" class="btn btn-primary editable-submit"><i class="fa fa-check fa-lg"></i></button><button type="button" class="btn editable-cancel"><i class="fa fa-times fa-lg"></i></button>';
+ $.fn.editableform.template = '' +
+ '<form class="form-inline editableform flexMaxWidth">' +
+ '<div class="control-group flexLayout flexMaxWidth">' +
+ '<div class="flexLayout flexMaxWidth"><div class="editable-input flexMaxWidth"></div><div class="editable-buttons"></div></div>' +
+ '<div class="editable-error-block"></div>' +
+ '</div> ' +
+ '</form>';
var exitFullscreenButton = '<button id="exitFullScreen" class="btn btn-link" title="Exit fullscreen mode (ESC)"><span class="fa fa-remove"></span></button>';
var _isEditMode = false; // If a file is currently opened for editing, this var should be true
@@ -434,13 +440,23 @@ define(function(require, exports, module) {
if (!isChrome) {
$fileTitle.editable({
type: 'text',
- //placement: 'bottom',
- title: 'Change Title',
+ title: 'Enter Title',
mode: 'inline',
+ clear: false,
success: function(response, newValue) {
+ $('#closeOpenedFile').show();
TSCORE.TagUtils.changeTitle(_openedFilePath, newValue);
+ },
+ error: function(response, newValue) {
+ $('#closeOpenedFile').show();
}
});
+ $fileTitle.on('shown', function(e, editable) {
+ $('#closeOpenedFile').hide();
+ });
+ $fileTitle.on('hidden', function(e, editable) {
+ $('#closeOpenedFile').show();
+ });
}
// Generate tag & ext buttons
// Appending tag buttons