fix: Show Text tab for horizontal and vertical line settings
This commit is contained in:
@ -1193,7 +1193,7 @@ export class DrawingManager {
|
|||||||
|
|
||||||
window.switchTLTab = (tab) => {
|
window.switchTLTab = (tab) => {
|
||||||
this.activeTLTab = tab;
|
this.activeTLTab = tab;
|
||||||
const isLineWithText = this.selectedDrawing && ['trend_line', 'ray', 'rectangle'].includes(this.selectedDrawing.type);
|
const isLineWithText = this.selectedDrawing && ['trend_line', 'ray', 'rectangle', 'horizontal_line', 'vertical_line'].includes(this.selectedDrawing.type);
|
||||||
|
|
||||||
document.getElementById('tlTabStyle').className = tab === 'style' ? 'flex-1 py-2 text-center text-blue-500 border-b-2 border-blue-500 font-medium' : 'flex-1 py-2 text-center text-gray-400 hover:text-white';
|
document.getElementById('tlTabStyle').className = tab === 'style' ? 'flex-1 py-2 text-center text-blue-500 border-b-2 border-blue-500 font-medium' : 'flex-1 py-2 text-center text-gray-400 hover:text-white';
|
||||||
|
|
||||||
@ -1217,11 +1217,11 @@ export class DrawingManager {
|
|||||||
window.setTLThickness = (width) => this.applySettings('width', width);
|
window.setTLThickness = (width) => this.applySettings('width', width);
|
||||||
window.setTLStyle = (style) => this.applySettings('style', style);
|
window.setTLStyle = (style) => this.applySettings('style', style);
|
||||||
window.toggleTLBold = () => {
|
window.toggleTLBold = () => {
|
||||||
const current = this.selectedDrawing && ['trend_line', 'ray', 'rectangle'].includes(this.selectedDrawing.type) ? this.selectedDrawing.bold : this.defaults.trend_line.bold;
|
const current = this.selectedDrawing && ['trend_line', 'ray', 'rectangle', 'horizontal_line', 'vertical_line'].includes(this.selectedDrawing.type) ? this.selectedDrawing.bold : this.defaults.trend_line.bold;
|
||||||
this.applySettings('bold', !current);
|
this.applySettings('bold', !current);
|
||||||
};
|
};
|
||||||
window.toggleTLItalic = () => {
|
window.toggleTLItalic = () => {
|
||||||
const current = this.selectedDrawing && ['trend_line', 'ray', 'rectangle'].includes(this.selectedDrawing.type) ? this.selectedDrawing.italic : this.defaults.trend_line.italic;
|
const current = this.selectedDrawing && ['trend_line', 'ray', 'rectangle', 'horizontal_line', 'vertical_line'].includes(this.selectedDrawing.type) ? this.selectedDrawing.italic : this.defaults.trend_line.italic;
|
||||||
this.applySettings('italic', !current);
|
this.applySettings('italic', !current);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1314,7 +1314,7 @@ export class DrawingManager {
|
|||||||
|
|
||||||
if (show) {
|
if (show) {
|
||||||
panel.classList.remove('hidden');
|
panel.classList.remove('hidden');
|
||||||
const isLineWithText = this.selectedDrawing && ['trend_line', 'ray', 'rectangle'].includes(this.selectedDrawing.type);
|
const isLineWithText = this.selectedDrawing && ['trend_line', 'ray', 'rectangle', 'horizontal_line', 'vertical_line'].includes(this.selectedDrawing.type);
|
||||||
if (!isLineWithText) {
|
if (!isLineWithText) {
|
||||||
this.activeTLTab = 'style';
|
this.activeTLTab = 'style';
|
||||||
document.getElementById('tlTabStyle').className = 'flex-1 py-2 text-center text-blue-500 border-b-2 border-blue-500 font-medium';
|
document.getElementById('tlTabStyle').className = 'flex-1 py-2 text-center text-blue-500 border-b-2 border-blue-500 font-medium';
|
||||||
|
|||||||
Reference in New Issue
Block a user