replaced 3clicks with pointer
This commit is contained in:
parent
0c721ef7ed
commit
eab0d41a64
@ -500,11 +500,11 @@ export default class PropertyTemplateSelector extends LightningElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get isSerenityHouseTemplateSelected() {
|
get isSerenityHouseTemplateSelected() {
|
||||||
return this.selectedTemplateId === "serenity-house-template";
|
return this.selectedTemplateId === "serenity-house-template" || this.selectedTemplateId === "serenity-house-a3-template";
|
||||||
}
|
}
|
||||||
|
|
||||||
get isLuxuryMansionTemplateSelected() {
|
get isLuxuryMansionTemplateSelected() {
|
||||||
return this.selectedTemplateId === "luxury-mansion-template";
|
return this.selectedTemplateId === "luxury-mansion-template" || this.selectedTemplateId === "luxury-mansion-a3-template";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Image review computed properties
|
// Image review computed properties
|
||||||
@ -1318,8 +1318,10 @@ export default class PropertyTemplateSelector extends LightningElement {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.forceHTMLRendering();
|
this.forceHTMLRendering();
|
||||||
|
|
||||||
// Add pencil icon to hero section for modern home template
|
// Add pencil icon to hero section for modern home template, serenity house template, and luxury mansion template
|
||||||
if (this.selectedTemplateId === 'modern-home-template' || this.selectedTemplateId === 'modern-home-a3-template') {
|
if (this.selectedTemplateId === 'modern-home-template' || this.selectedTemplateId === 'modern-home-a3-template' ||
|
||||||
|
this.selectedTemplateId === 'serenity-house-template' || this.selectedTemplateId === 'serenity-house-a3-template' ||
|
||||||
|
this.selectedTemplateId === 'luxury-mansion-template' || this.selectedTemplateId === 'luxury-mansion-a3-template') {
|
||||||
this.addPencilIconToHeroSection();
|
this.addPencilIconToHeroSection();
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
@ -1691,8 +1693,10 @@ export default class PropertyTemplateSelector extends LightningElement {
|
|||||||
// Force proper HTML rendering to match PDF exactly
|
// Force proper HTML rendering to match PDF exactly
|
||||||
this.forceHTMLRendering();
|
this.forceHTMLRendering();
|
||||||
|
|
||||||
// Add pencil icon to hero section for modern home template
|
// Add pencil icon to hero section for modern home template, serenity house template, and luxury mansion template
|
||||||
if (this.selectedTemplateId === 'modern-home-template' || this.selectedTemplateId === 'modern-home-a3-template') {
|
if (this.selectedTemplateId === 'modern-home-template' || this.selectedTemplateId === 'modern-home-a3-template' ||
|
||||||
|
this.selectedTemplateId === 'serenity-house-template' || this.selectedTemplateId === 'serenity-house-a3-template' ||
|
||||||
|
this.selectedTemplateId === 'luxury-mansion-template' || this.selectedTemplateId === 'luxury-mansion-a3-template') {
|
||||||
this.addPencilIconToHeroSection();
|
this.addPencilIconToHeroSection();
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
@ -1762,8 +1766,10 @@ export default class PropertyTemplateSelector extends LightningElement {
|
|||||||
// Force proper HTML rendering to match PDF exactly
|
// Force proper HTML rendering to match PDF exactly
|
||||||
this.forceHTMLRendering();
|
this.forceHTMLRendering();
|
||||||
|
|
||||||
// Add pencil icon to hero section for modern home template
|
// Add pencil icon to hero section for modern home template, serenity house template, and luxury mansion template
|
||||||
if (this.selectedTemplateId === 'modern-home-template' || this.selectedTemplateId === 'modern-home-a3-template') {
|
if (this.selectedTemplateId === 'modern-home-template' || this.selectedTemplateId === 'modern-home-a3-template' ||
|
||||||
|
this.selectedTemplateId === 'serenity-house-template' || this.selectedTemplateId === 'serenity-house-a3-template' ||
|
||||||
|
this.selectedTemplateId === 'luxury-mansion-template' || this.selectedTemplateId === 'luxury-mansion-a3-template') {
|
||||||
this.addPencilIconToHeroSection();
|
this.addPencilIconToHeroSection();
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
@ -7231,7 +7237,6 @@ ${galleryPagesHTML}
|
|||||||
|
|
||||||
<h3 class="section-title">Property Details</h3>
|
<h3 class="section-title">Property Details</h3>
|
||||||
<div class="details-grid">
|
<div class="details-grid">
|
||||||
<div class="details-item"><span class="label">Status</span><span class="value">${status}</span></div>
|
|
||||||
<div class="details-item"><span class="label">Year Built</span><span class="value">${yearBuilt}</span></div>
|
<div class="details-item"><span class="label">Year Built</span><span class="value">${yearBuilt}</span></div>
|
||||||
<div class="details-item"><span class="label">Type</span><span class="value">${propertyType}</span></div>
|
<div class="details-item"><span class="label">Type</span><span class="value">${propertyType}</span></div>
|
||||||
<div class="details-item"><span class="label">Furnishing</span><span class="value">${furnishing}</span></div>
|
<div class="details-item"><span class="label">Furnishing</span><span class="value">${furnishing}</span></div>
|
||||||
@ -8191,7 +8196,7 @@ ${galleryPagesHTML}
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div style="margin-top: 10px;">
|
||||||
<h3 class="section-title" >Additional Information</h3>
|
<h3 class="section-title" >Additional Information</h3>
|
||||||
<div class="additional-specs-grid">
|
<div class="additional-specs-grid">
|
||||||
<div class="spec-item"><div class="label">Available from</div><div class="value">${this.propertyData.rentAvailableFrom}</div></div>
|
<div class="spec-item"><div class="label">Available from</div><div class="value">${this.propertyData.rentAvailableFrom}</div></div>
|
||||||
@ -15527,9 +15532,9 @@ ${galleryPagesHTML}
|
|||||||
console.log("Clicked image:", clickedImage);
|
console.log("Clicked image:", clickedImage);
|
||||||
console.log("Event:", event);
|
console.log("Event:", event);
|
||||||
|
|
||||||
// Disable 3-click functionality for modern home template
|
// Disable 3-click functionality for modern home template, serenity house template, and luxury mansion template
|
||||||
if (this.isModernHomeTemplateSelected) {
|
if (this.isModernHomeTemplateSelected || this.isSerenityHouseTemplateSelected || this.isLuxuryMansionTemplateSelected) {
|
||||||
console.log("❌ 3-click functionality disabled for modern home template");
|
console.log("❌ 3-click functionality disabled for modern home template, serenity house template, and luxury mansion template");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16959,7 +16964,20 @@ ${galleryPagesHTML}
|
|||||||
|
|
||||||
// Add pencil icon to hero section (page 1)
|
// Add pencil icon to hero section (page 1)
|
||||||
console.log('Looking for hero section...');
|
console.log('Looking for hero section...');
|
||||||
const heroSection = editorContent.querySelector('.hero');
|
let heroSection = editorContent.querySelector('.hero');
|
||||||
|
|
||||||
|
// For serenity house template, look for .p1-image-side instead
|
||||||
|
if (!heroSection && (this.selectedTemplateId === 'serenity-house-template' || this.selectedTemplateId === 'serenity-house-a3-template')) {
|
||||||
|
console.log('Looking for serenity house template first image section...');
|
||||||
|
heroSection = editorContent.querySelector('.p1-image-side');
|
||||||
|
}
|
||||||
|
|
||||||
|
// For luxury mansion template, look for .cover-page instead
|
||||||
|
if (!heroSection && (this.selectedTemplateId === 'luxury-mansion-template' || this.selectedTemplateId === 'luxury-mansion-a3-template')) {
|
||||||
|
console.log('Looking for luxury mansion template cover page...');
|
||||||
|
heroSection = editorContent.querySelector('.cover-page');
|
||||||
|
}
|
||||||
|
|
||||||
if (heroSection) {
|
if (heroSection) {
|
||||||
console.log('Hero section found');
|
console.log('Hero section found');
|
||||||
if (!heroSection.querySelector('.hero-edit-icon')) {
|
if (!heroSection.querySelector('.hero-edit-icon')) {
|
||||||
@ -17012,6 +17030,36 @@ ${galleryPagesHTML}
|
|||||||
} else {
|
} else {
|
||||||
console.log('Visual header not found in editor content');
|
console.log('Visual header not found in editor content');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add pencil icon to floor plans section for luxury mansion template
|
||||||
|
if (this.selectedTemplateId === 'luxury-mansion-template' || this.selectedTemplateId === 'luxury-mansion-a3-template') {
|
||||||
|
console.log('Looking for luxury mansion floor plans section...');
|
||||||
|
const floorplanImage = editorContent.querySelector('.floorplan-image-p5');
|
||||||
|
if (floorplanImage) {
|
||||||
|
console.log('Floor plans image found');
|
||||||
|
if (!floorplanImage.querySelector('.hero-edit-icon')) {
|
||||||
|
console.log('Creating pencil icon for floor plans image...');
|
||||||
|
// Create pencil icon element
|
||||||
|
const pencilIcon = document.createElement('div');
|
||||||
|
pencilIcon.className = 'hero-edit-icon';
|
||||||
|
pencilIcon.innerHTML = '<i class="fa-solid fa-pencil" style="font-size: 16px;"></i>';
|
||||||
|
pencilIcon.title = 'Replace Floor Plans Image';
|
||||||
|
pencilIcon.onclick = () => {
|
||||||
|
console.log('Floor plans pencil icon clicked');
|
||||||
|
// Trigger image replacement for floor plans
|
||||||
|
this.handleFloorPlansImageReplacement();
|
||||||
|
};
|
||||||
|
|
||||||
|
// Add the pencil icon to the floor plans image
|
||||||
|
floorplanImage.appendChild(pencilIcon);
|
||||||
|
console.log('Pencil icon added to floor plans image successfully');
|
||||||
|
} else {
|
||||||
|
console.log('Floor plans pencil icon already exists');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('Floor plans image not found in editor content');
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('Enhanced editor content not found');
|
console.log('Enhanced editor content not found');
|
||||||
}
|
}
|
||||||
@ -17023,7 +17071,20 @@ ${galleryPagesHTML}
|
|||||||
// Find the hero section background image
|
// Find the hero section background image
|
||||||
const editorContent = this.template.querySelector('.enhanced-editor-content');
|
const editorContent = this.template.querySelector('.enhanced-editor-content');
|
||||||
if (editorContent) {
|
if (editorContent) {
|
||||||
const heroSection = editorContent.querySelector('.hero');
|
let heroSection = editorContent.querySelector('.hero');
|
||||||
|
|
||||||
|
// For serenity house template, look for .p1-image-side instead
|
||||||
|
if (!heroSection && (this.selectedTemplateId === 'serenity-house-template' || this.selectedTemplateId === 'serenity-house-a3-template')) {
|
||||||
|
console.log('Looking for serenity house template first image section for replacement...');
|
||||||
|
heroSection = editorContent.querySelector('.p1-image-side');
|
||||||
|
}
|
||||||
|
|
||||||
|
// For luxury mansion template, look for .cover-page instead
|
||||||
|
if (!heroSection && (this.selectedTemplateId === 'luxury-mansion-template' || this.selectedTemplateId === 'luxury-mansion-a3-template')) {
|
||||||
|
console.log('Looking for luxury mansion template cover page for replacement...');
|
||||||
|
heroSection = editorContent.querySelector('.cover-page');
|
||||||
|
}
|
||||||
|
|
||||||
if (heroSection) {
|
if (heroSection) {
|
||||||
// Get the computed background image
|
// Get the computed background image
|
||||||
const computedStyle = window.getComputedStyle(heroSection);
|
const computedStyle = window.getComputedStyle(heroSection);
|
||||||
@ -17080,6 +17141,37 @@ ${galleryPagesHTML}
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle floor plans image replacement for luxury mansion template
|
||||||
|
handleFloorPlansImageReplacement() {
|
||||||
|
// Find the floor plans background image
|
||||||
|
const editorContent = this.template.querySelector('.enhanced-editor-content');
|
||||||
|
if (editorContent) {
|
||||||
|
const floorplanImage = editorContent.querySelector('.floorplan-image-p5');
|
||||||
|
if (floorplanImage) {
|
||||||
|
// Get the computed background image
|
||||||
|
const computedStyle = window.getComputedStyle(floorplanImage);
|
||||||
|
const backgroundImage = computedStyle.backgroundImage;
|
||||||
|
|
||||||
|
if (backgroundImage && backgroundImage !== 'none') {
|
||||||
|
// Create a virtual image element for the floor plans background
|
||||||
|
const virtualImg = document.createElement('img');
|
||||||
|
virtualImg.src = backgroundImage.replace(/url\(['"]?(.+?)['"]?\)/, '$1');
|
||||||
|
virtualImg.isBackgroundImage = true;
|
||||||
|
virtualImg.originalElement = floorplanImage;
|
||||||
|
|
||||||
|
// Open image replacement for this virtual image
|
||||||
|
this.openImageReplacement(virtualImg);
|
||||||
|
} else {
|
||||||
|
console.log('No background image found on floor plans image');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('Floor plans image not found');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('Enhanced editor content not found');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Method to replace background-image URLs in CSS at runtime
|
// Method to replace background-image URLs in CSS at runtime
|
||||||
replaceBackgroundImagesInHTML(htmlContent) {
|
replaceBackgroundImagesInHTML(htmlContent) {
|
||||||
if (!this.realPropertyImages || this.realPropertyImages.length === 0) {
|
if (!this.realPropertyImages || this.realPropertyImages.length === 0) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user