FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: missing style tag when no html template loaded by castastrophe · Pull Request #1503 · patternfly/patternfly-elements · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .html  (1) .js  (4) .json  (1) .md  (1) .png  (2) All 5 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
5 changes: 3 additions & 2 deletions CHANGELOG-1.x.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 1.4.0 (2021)
# 1.4.0 (2021-03-30)

- [](https://github.com/patternfly/patternfly-elements/commit/) feat: Add performance marks to PFElement for more accurate reporting on performance
- [76c2c36](https://github.com/patternfly/patternfly-elements/commit/76c2c3689a9a338b278d99f6e2d3cbeef4f3cc3d) feat: Add performance marks to PFElement for more accurate reporting on performance
- [](https://github.com/patternfly/patternfly-elements/commit/) fix: pfe-content-set bring back template to inject style tag for alignment settings

# 1.3.4 (2021-03-29)

Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div id="container"></div>
10 changes: 7 additions & 3 deletions elements/pfe-content-set/src/pfe-content-set.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ class PfeContentSet extends PFElement {
return "pfe-content-set.scss";
}

get templateUrl() {
return "pfe-content-set.html";
}

static get meta() {
return {
title: "Content set",
Expand Down Expand Up @@ -171,7 +175,7 @@ class PfeContentSet extends PFElement {
get view() {
if (!this._rendered) return;

return this.shadowRoot.querySelector(this.expectedTag);
return this.shadowRoot.querySelector(`#container > ${this.expectedTag}`);
}

/**
Expand Down Expand Up @@ -475,8 +479,8 @@ class PfeContentSet extends PFElement {
// @todo find out why we need this shim
// Shadydom breaks if we use innerHTML to set the new content but Selenium will infinitely
// loop in out tests if we use appendChild.
if (window.ShadyDOM) this.shadowRoot.appendChild(view);
else this.shadowRoot.innerHTML = view.outerHTML;
if (window.ShadyDOM) this.shadowRoot.querySelector(`#container`).appendChild(view);
else this.shadowRoot.querySelector(`#container`).innerHTML = view.outerHTML;

Promise.all([customElements.whenDefined(tag)]).then(() => {
this.cascadeProperties();
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ suite("<pfe-content-set> cascading attributes", () => {
pfeContentSet.setAttribute("vertical", "");

flush(() => {
const pfeTabs = pfeContentSet.shadowRoot.querySelector(':scope > pfe-tabs');
const pfeTabs = pfeContentSet.shadowRoot.querySelector('pfe-tabs');
assert.equal(pfeContentSet.getAttribute("vertical"), pfeTabs.getAttribute("vertical"));

done();
Expand Down
10 changes: 3 additions & 7 deletions elements/pfelement/src/pfelement.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ class PFElement extends HTMLElement {
} else if (this.id.startsWith("pfe-") && !this.id.startsWith(this.tag)) {
this._markId = this.id.replace("pfe", this.tag);
} else {
this._markId = `${this.tag}-${this.id}`;
this._markId = `${this.tag}-${this.id}`;
}

this._markCount = 0;
Expand Down Expand Up @@ -421,16 +421,12 @@ class PFElement extends HTMLElement {
if (PFElement.trackPerformance()) {
try {
performance.mark(`${this._markId}-rendered`);

if (this._markCount < 1) {
this._markCount = this._markCount + 1;

// Navigation start, i.e., the browser first sees that the user has navigated to the page
performance.measure(
`${this._markId}-from-navigation-to-first-render`,
undefined,
`${this._markId}-rendered`
);
performance.measure(`${this._markId}-from-navigation-to-first-render`, undefined, `${this._markId}-rendered`);

// Render is run before connection unless delayRender is used
performance.measure(
Expand Down
11 changes: 11 additions & 0 deletions elements/pfelement/src/polyfills--pfelement.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,14 @@ if (!Object.entries) {
return resArray;
};
}

// @POLYFILL String.startsWith
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith#polyfill
if (!String.prototype.startsWith) {
Object.defineProperty(String.prototype, "startsWith", {
value: function(search, rawPos) {
var pos = rawPos > 0 ? rawPos | 0 : 0;
return this.substring(pos, pos + search.length) === search;
}
});
}
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified test/vrt-baseline/desktop_chrome/pfe-content-set.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Viewer requires iframe.
Binary file modified test/vrt-baseline/desktop_ie/pfe-content-set.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Viewer requires iframe.

Back | FazBrowse Home | New Git URL