mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 03:29:02 +01:00 
			
		
		
		
	cannot edit note title when not in protected session
This commit is contained in:
		
							parent
							
								
									d4db265fd9
								
							
						
					
					
						commit
						35bc1421f1
					
				| @ -109,6 +109,10 @@ function onNoteChange(func) { | |||||||
| async function saveNote() { | async function saveNote() { | ||||||
|     const note = getCurrentNote(); |     const note = getCurrentNote(); | ||||||
| 
 | 
 | ||||||
|  |     if (note.isProtected && !protectedSessionHolder.isProtectedSessionAvailable()) { | ||||||
|  |         return; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     note.title = $noteTitle.val(); |     note.title = $noteTitle.val(); | ||||||
|     note.content = getCurrentNoteContent(note); |     note.content = getCurrentNoteContent(note); | ||||||
| 
 | 
 | ||||||
| @ -223,6 +227,8 @@ async function loadNoteDetail(noteId) { | |||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |         $noteTitle.removeAttr("readonly"); // this can be set by protected session service
 | ||||||
|  | 
 | ||||||
|         await getComponent(currentNote.type).show(); |         await getComponent(currentNote.type).show(); | ||||||
|     } |     } | ||||||
|     finally { |     finally { | ||||||
|  | |||||||
| @ -15,6 +15,7 @@ const $protectButton = $("#protect-button"); | |||||||
| const $unprotectButton = $("#unprotect-button"); | const $unprotectButton = $("#unprotect-button"); | ||||||
| const $enterProtectedSessionButton = $("#enter-protected-session-button"); | const $enterProtectedSessionButton = $("#enter-protected-session-button"); | ||||||
| const $leaveProtectedSessionButton = $("#leave-protected-session-button"); | const $leaveProtectedSessionButton = $("#leave-protected-session-button"); | ||||||
|  | const $noteTitle = $("#note-title"); | ||||||
| 
 | 
 | ||||||
| let protectedSessionDeferred = null; | let protectedSessionDeferred = null; | ||||||
| 
 | 
 | ||||||
| @ -38,6 +39,9 @@ function ensureProtectedSession(requireProtectedSession, modal) { | |||||||
|         // using deferred instead of promise because it allows resolving from outside
 |         // using deferred instead of promise because it allows resolving from outside
 | ||||||
|         protectedSessionDeferred = dfd; |         protectedSessionDeferred = dfd; | ||||||
| 
 | 
 | ||||||
|  |         // user shouldn't be able to edit note title
 | ||||||
|  |         $noteTitle.prop("readonly", true); | ||||||
|  | 
 | ||||||
|         if (modal) { |         if (modal) { | ||||||
|             if (treeService.getCurrentNode().data.isProtected) { |             if (treeService.getCurrentNode().data.isProtected) { | ||||||
|                 $noteDetailWrapper.hide(); |                 $noteDetailWrapper.hide(); | ||||||
|  | |||||||
| @ -84,3 +84,7 @@ html, body { | |||||||
| .fancytree-node.fancytree-expanded .fancytree-expander:before { | .fancytree-node.fancytree-expanded .fancytree-expander:before { | ||||||
|     content: "\e9ba"; |     content: "\e9ba"; | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | kbd { | ||||||
|  |     display: none; | ||||||
|  | } | ||||||
| @ -57,6 +57,18 @@ body { | |||||||
|     grid-area: title; |     grid-area: title; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | #note-title { | ||||||
|  |     margin-left: 15px; | ||||||
|  |     font-size: x-large; | ||||||
|  |     border: 0; | ||||||
|  |     width: 5em; | ||||||
|  |     flex-grow: 100; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | #note-title[readonly] { | ||||||
|  |     background: inherit; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| .tdialog { | .tdialog { | ||||||
|     display: none; |     display: none; | ||||||
| } | } | ||||||
|  | |||||||
| @ -112,7 +112,7 @@ | |||||||
|                 </ul> |                 </ul> | ||||||
|             </div> |             </div> | ||||||
| 
 | 
 | ||||||
|             <input autocomplete="off" value="" id="note-title" style="margin-left: 15px; font-size: x-large; border: 0; width: 5em; flex-grow: 100;" tabindex="1"> |             <input autocomplete="off" value="" id="note-title" tabindex="1"> | ||||||
| 
 | 
 | ||||||
|             <div class="hide-toggle" style="display: flex; align-items: center;"> |             <div class="hide-toggle" style="display: flex; align-items: center;"> | ||||||
|                 <span id="note-id-display" title="Note ID"></span> |                 <span id="note-id-display" title="Note ID"></span> | ||||||
|  | |||||||
| @ -35,6 +35,8 @@ | |||||||
|             <% include details/image.ejs %> |             <% include details/image.ejs %> | ||||||
| 
 | 
 | ||||||
|             <% include details/relation_map.ejs %> |             <% include details/relation_map.ejs %> | ||||||
|  | 
 | ||||||
|  |             <% include details/protected_session_password.ejs %> | ||||||
|         </div> |         </div> | ||||||
|     </div> |     </div> | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 azivner
						azivner