From 37e705aed424718a21e2be0a30f6ff4bbb678060 Mon Sep 17 00:00:00 2001 From: rakeshkumar1019 Date: Tue, 17 Dec 2024 09:52:32 +0530 Subject: [PATCH 1/5] ELEMENTS-1777: rtl support thumbnail & card --- .../nuxeo-document-thumbnail.js | 12 ++++++++++++ ui/widgets/nuxeo-card.js | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/ui/nuxeo-document-thumbnail/nuxeo-document-thumbnail.js b/ui/nuxeo-document-thumbnail/nuxeo-document-thumbnail.js index ef554ad99..4cc02cbb1 100644 --- a/ui/nuxeo-document-thumbnail/nuxeo-document-thumbnail.js +++ b/ui/nuxeo-document-thumbnail/nuxeo-document-thumbnail.js @@ -58,6 +58,10 @@ import { I18nBehavior } from '../nuxeo-i18n-behavior'; filter: brightness(1.2); -webkit-filter: brightness(1.2); } + + :host([dir="rtl"]) img { + margin: auto auto auto 8px; + } [[_title(document)]] @@ -74,6 +78,14 @@ import { I18nBehavior } from '../nuxeo-i18n-behavior'; }; } + connectedCallback() { + super.connectedCallback(); + if (!this.hasAttribute('dir')) { + this.setAttribute('dir', getComputedStyle(this).direction); + } + } + + _thumbnail(doc) { if ( doc && diff --git a/ui/widgets/nuxeo-card.js b/ui/widgets/nuxeo-card.js index 783b29688..1e9d2933d 100644 --- a/ui/widgets/nuxeo-card.js +++ b/ui/widgets/nuxeo-card.js @@ -98,6 +98,11 @@ import { mixinBehaviors } from '@polymer/polymer/lib/legacy/class.js'; --iron-icon-width: 16px; --iron-icon-height: 16px; } + + :host([dir="rtl"]) .header .icon { + margin-left: 8px; + margin-right: 0; + } .header .toggle { --iron-icon-width: 20px; @@ -173,6 +178,13 @@ import { mixinBehaviors } from '@polymer/polymer/lib/legacy/class.js'; }; } + connectedCallback() { + super.connectedCallback(); + if (!this.hasAttribute('dir')) { + this.setAttribute('dir', getComputedStyle(this).direction); + } + } + _hasHeading(icon, heading, collapsible) { return icon || heading || collapsible; } From 27aa848d4c99a9625fdce70196a665fd74e0f65b Mon Sep 17 00:00:00 2001 From: rakeshkumar1019 Date: Tue, 17 Dec 2024 10:02:40 +0530 Subject: [PATCH 2/5] ELEMENTS-1777: rtl support thumbnail & card --- .../nuxeo-document-thumbnail.js | 8 ++++---- ui/widgets/nuxeo-card.js | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ui/nuxeo-document-thumbnail/nuxeo-document-thumbnail.js b/ui/nuxeo-document-thumbnail/nuxeo-document-thumbnail.js index 4cc02cbb1..0fcf7a63f 100644 --- a/ui/nuxeo-document-thumbnail/nuxeo-document-thumbnail.js +++ b/ui/nuxeo-document-thumbnail/nuxeo-document-thumbnail.js @@ -42,6 +42,10 @@ import { I18nBehavior } from '../nuxeo-i18n-behavior'; flex: none; } + :host([dir="rtl"]) img { + margin: auto auto auto 8px; + } + img { height: auto; width: auto; @@ -58,10 +62,6 @@ import { I18nBehavior } from '../nuxeo-i18n-behavior'; filter: brightness(1.2); -webkit-filter: brightness(1.2); } - - :host([dir="rtl"]) img { - margin: auto auto auto 8px; - } [[_title(document)]] diff --git a/ui/widgets/nuxeo-card.js b/ui/widgets/nuxeo-card.js index 1e9d2933d..baea2ee9d 100644 --- a/ui/widgets/nuxeo-card.js +++ b/ui/widgets/nuxeo-card.js @@ -72,6 +72,11 @@ import { mixinBehaviors } from '@polymer/polymer/lib/legacy/class.js'; cursor: pointer; @apply --nuxeo-link-hover; } + + :host([dir="rtl"]) .header .icon { + margin-left: 8px; + margin-right: 0; + } [hidden] { display: none !important; @@ -99,11 +104,6 @@ import { mixinBehaviors } from '@polymer/polymer/lib/legacy/class.js'; --iron-icon-height: 16px; } - :host([dir="rtl"]) .header .icon { - margin-left: 8px; - margin-right: 0; - } - .header .toggle { --iron-icon-width: 20px; --iron-icon-height: 20px; From ec142cd5929d9f3307a8dbc9d66893e612655503 Mon Sep 17 00:00:00 2001 From: rakeshkumar1019 Date: Tue, 17 Dec 2024 10:32:35 +0530 Subject: [PATCH 3/5] ELEMENTS-1777: lint issue --- ui/widgets/nuxeo-card.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/widgets/nuxeo-card.js b/ui/widgets/nuxeo-card.js index baea2ee9d..cb822e333 100644 --- a/ui/widgets/nuxeo-card.js +++ b/ui/widgets/nuxeo-card.js @@ -181,7 +181,7 @@ import { mixinBehaviors } from '@polymer/polymer/lib/legacy/class.js'; connectedCallback() { super.connectedCallback(); if (!this.hasAttribute('dir')) { - this.setAttribute('dir', getComputedStyle(this).direction); + this.setAttribute('dir', getComputedStyle(this).direction); } } From 4440ce506b61bf28e769b8def369e7bda263bca4 Mon Sep 17 00:00:00 2001 From: rakeshkumar1019 Date: Tue, 17 Dec 2024 10:43:54 +0530 Subject: [PATCH 4/5] ELEMENTS-1777: lint issue --- ui/widgets/nuxeo-card.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ui/widgets/nuxeo-card.js b/ui/widgets/nuxeo-card.js index cb822e333..18d6a55ea 100644 --- a/ui/widgets/nuxeo-card.js +++ b/ui/widgets/nuxeo-card.js @@ -177,14 +177,6 @@ import { mixinBehaviors } from '@polymer/polymer/lib/legacy/class.js'; }, }; } - - connectedCallback() { - super.connectedCallback(); - if (!this.hasAttribute('dir')) { - this.setAttribute('dir', getComputedStyle(this).direction); - } - } - _hasHeading(icon, heading, collapsible) { return icon || heading || collapsible; } From f5f775d5f9bf75db6ea06aa2847b143b39a616fa Mon Sep 17 00:00:00 2001 From: rakeshkumar1019 Date: Tue, 17 Dec 2024 10:49:43 +0530 Subject: [PATCH 5/5] ELEMENTS-1777: lint issue --- ui/widgets/nuxeo-card.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ui/widgets/nuxeo-card.js b/ui/widgets/nuxeo-card.js index 18d6a55ea..baea2ee9d 100644 --- a/ui/widgets/nuxeo-card.js +++ b/ui/widgets/nuxeo-card.js @@ -177,6 +177,14 @@ import { mixinBehaviors } from '@polymer/polymer/lib/legacy/class.js'; }, }; } + + connectedCallback() { + super.connectedCallback(); + if (!this.hasAttribute('dir')) { + this.setAttribute('dir', getComputedStyle(this).direction); + } + } + _hasHeading(icon, heading, collapsible) { return icon || heading || collapsible; }