empty title still reserves the same space as set title for layout consistency
This commit is contained in:
@@ -4281,6 +4281,10 @@ span.placeholder {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.item_title:empty::before {
|
||||
content: '\00a0';
|
||||
}
|
||||
|
||||
.location {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
@@ -9200,25 +9200,19 @@ if (navigator.vibrate) {
|
||||
saveBtn.innerHTML = origIcon;
|
||||
if (data.success) {
|
||||
// Update the live .item_title bar below the ID bar
|
||||
let titleBar = document.querySelector('.item_title');
|
||||
if (data.title) {
|
||||
const titleBar = document.querySelector('.item_title');
|
||||
if (titleBar) {
|
||||
titleBar.textContent = data.title;
|
||||
titleBar.style.display = '';
|
||||
} else {
|
||||
// Create it if it doesn't exist yet
|
||||
titleBar.textContent = data.title || '';
|
||||
} else if (data.title) {
|
||||
// Fallback: create it if somehow missing (e.g. enable_item_title was toggled)
|
||||
const idBar = document.querySelector('.item-main-content > ._204863');
|
||||
if (idBar) {
|
||||
titleBar = document.createElement('div');
|
||||
titleBar.className = 'item_title';
|
||||
titleBar.textContent = data.title;
|
||||
idBar.insertAdjacentElement('afterend', titleBar);
|
||||
const newBar = document.createElement('div');
|
||||
newBar.className = 'item_title';
|
||||
newBar.textContent = data.title;
|
||||
idBar.insertAdjacentElement('afterend', newBar);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Title cleared
|
||||
if (titleBar) titleBar.remove();
|
||||
}
|
||||
if (status) {
|
||||
status.textContent = '✓ Saved';
|
||||
status.style.color = 'var(--accent, #5cb85c)';
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
<div class="location">{{ link.main }}{{ item.id }}{{ link.suffix }}</div>
|
||||
<div class="gapLeft"></div>
|
||||
</div>
|
||||
@if(enable_item_title && item.title)
|
||||
<div class="item_title">{!! item.title !!}</div>
|
||||
@if(enable_item_title)
|
||||
<div class="item_title">{!! item.title || '' !!}</div>
|
||||
@endif
|
||||
|
||||
<div class="content">
|
||||
|
||||
@@ -60,8 +60,8 @@
|
||||
<div class="location">{{ link.main }}{{ item.id }}{{ link.suffix }}</div>
|
||||
<div class="gapLeft"></div>
|
||||
</div>
|
||||
@if(enable_item_title && item.title)
|
||||
<div class="item_title">{!! item.title !!}</div>
|
||||
@if(enable_item_title)
|
||||
<div class="item_title">{!! item.title || '' !!}</div>
|
||||
@endif
|
||||
|
||||
<div class="content">
|
||||
|
||||
Reference in New Issue
Block a user