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;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.item_title:empty::before {
|
||||||
|
content: '\00a0';
|
||||||
|
}
|
||||||
|
|
||||||
.location {
|
.location {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9200,24 +9200,18 @@ if (navigator.vibrate) {
|
|||||||
saveBtn.innerHTML = origIcon;
|
saveBtn.innerHTML = origIcon;
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
// Update the live .item_title bar below the ID bar
|
// Update the live .item_title bar below the ID bar
|
||||||
let titleBar = document.querySelector('.item_title');
|
const titleBar = document.querySelector('.item_title');
|
||||||
if (data.title) {
|
if (titleBar) {
|
||||||
if (titleBar) {
|
titleBar.textContent = data.title || '';
|
||||||
titleBar.textContent = data.title;
|
} else if (data.title) {
|
||||||
titleBar.style.display = '';
|
// Fallback: create it if somehow missing (e.g. enable_item_title was toggled)
|
||||||
} else {
|
const idBar = document.querySelector('.item-main-content > ._204863');
|
||||||
// Create it if it doesn't exist yet
|
if (idBar) {
|
||||||
const idBar = document.querySelector('.item-main-content > ._204863');
|
const newBar = document.createElement('div');
|
||||||
if (idBar) {
|
newBar.className = 'item_title';
|
||||||
titleBar = document.createElement('div');
|
newBar.textContent = data.title;
|
||||||
titleBar.className = 'item_title';
|
idBar.insertAdjacentElement('afterend', newBar);
|
||||||
titleBar.textContent = data.title;
|
|
||||||
idBar.insertAdjacentElement('afterend', titleBar);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// Title cleared
|
|
||||||
if (titleBar) titleBar.remove();
|
|
||||||
}
|
}
|
||||||
if (status) {
|
if (status) {
|
||||||
status.textContent = '✓ Saved';
|
status.textContent = '✓ Saved';
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
<div class="location">{{ link.main }}{{ item.id }}{{ link.suffix }}</div>
|
<div class="location">{{ link.main }}{{ item.id }}{{ link.suffix }}</div>
|
||||||
<div class="gapLeft"></div>
|
<div class="gapLeft"></div>
|
||||||
</div>
|
</div>
|
||||||
@if(enable_item_title && item.title)
|
@if(enable_item_title)
|
||||||
<div class="item_title">{!! item.title !!}</div>
|
<div class="item_title">{!! item.title || '' !!}</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|||||||
@@ -60,8 +60,8 @@
|
|||||||
<div class="location">{{ link.main }}{{ item.id }}{{ link.suffix }}</div>
|
<div class="location">{{ link.main }}{{ item.id }}{{ link.suffix }}</div>
|
||||||
<div class="gapLeft"></div>
|
<div class="gapLeft"></div>
|
||||||
</div>
|
</div>
|
||||||
@if(enable_item_title && item.title)
|
@if(enable_item_title)
|
||||||
<div class="item_title">{!! item.title !!}</div>
|
<div class="item_title">{!! item.title || '' !!}</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|||||||
Reference in New Issue
Block a user