Skip to content

Commit 5212a87

Browse files
authored
fix: fix playground theme switch (#62)
1 parent 1b4715f commit 5212a87

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

packages/base/src/sap/ui/webcomponents/base/shims/jquery-shim.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { inject as injectJQuery } from "@ui5/webcomponents-core/dist/sap/ui/thirdparty/jquery";
2-
import fnIsPlainObject from "@ui5/webcomponents-core/dist/sap/base/util/isPlainObject";
2+
import isPlainObject from "@ui5/webcomponents-core/dist/sap/base/util/isPlainObject";
33

44
var jQuery = {
55
extend: function() {
@@ -45,15 +45,15 @@ var jQuery = {
4545
}
4646

4747
// Recurse if we're merging plain objects or arrays
48-
if ( deep && copy && ( fnIsPlainObject( copy ) ||
48+
if ( deep && copy && ( isPlainObject( copy ) ||
4949
( copyIsArray = Array.isArray( copy ) ) ) ) {
5050

5151
if ( copyIsArray ) {
5252
copyIsArray = false;
5353
clone = src && Array.isArray( src ) ? src : [];
5454

5555
} else {
56-
clone = src && fnIsPlainObject( src ) ? src : {};
56+
clone = src && isPlainObject( src ) ? src : {};
5757
}
5858

5959
// Never move original objects, clone them
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
(function() {
2-
var HCB = "sap_belize_hcb";
3-
var theme = window["sap-ui-webcomponents-main-bundle"].Core.getConfiguration().theme;
4-
var documentBody = document.body;
5-
if(theme === HCB) {
6-
documentBody.classList.add("hcb-background");
7-
} else {
8-
documentBody.classList.remove("hcb-background");
9-
}
10-
11-
window.onload =function() {
12-
//Inform parent when loaded to attach handlers for scroll
13-
parent.postMessage("Iframe Loaded Successfully", "*");
14-
};
15-
})();
1+
(function() {
2+
var HCB = "sap_belize_hcb";
3+
var theme = window["sap-ui-webcomponents-main-bundle"].configuration.getTheme();
4+
var documentBody = document.body;
5+
if(theme === HCB) {
6+
documentBody.classList.add("hcb-background");
7+
} else {
8+
documentBody.classList.remove("hcb-background");
9+
}
10+
11+
window.onload =function() {
12+
//Inform parent when loaded to attach handlers for scroll
13+
parent.postMessage("Iframe Loaded Successfully", "*");
14+
};
15+
})();

0 commit comments

Comments
 (0)