Skip to content

Commit

Permalink
fix: fix playground theme switch (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladitasev authored Feb 15, 2019
1 parent 1b4715f commit 5212a87
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { inject as injectJQuery } from "@ui5/webcomponents-core/dist/sap/ui/thirdparty/jquery";
import fnIsPlainObject from "@ui5/webcomponents-core/dist/sap/base/util/isPlainObject";
import isPlainObject from "@ui5/webcomponents-core/dist/sap/base/util/isPlainObject";

var jQuery = {
extend: function() {
Expand Down Expand Up @@ -45,15 +45,15 @@ var jQuery = {
}

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

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

} else {
clone = src && fnIsPlainObject( src ) ? src : {};
clone = src && isPlainObject( src ) ? src : {};
}

// Never move original objects, clone them
Expand Down
30 changes: 15 additions & 15 deletions packages/playground/webapp/www/samples/settings.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
(function() {
var HCB = "sap_belize_hcb";
var theme = window["sap-ui-webcomponents-main-bundle"].Core.getConfiguration().theme;
var documentBody = document.body;
if(theme === HCB) {
documentBody.classList.add("hcb-background");
} else {
documentBody.classList.remove("hcb-background");
}

window.onload =function() {
//Inform parent when loaded to attach handlers for scroll
parent.postMessage("Iframe Loaded Successfully", "*");
};
})();
(function() {
var HCB = "sap_belize_hcb";
var theme = window["sap-ui-webcomponents-main-bundle"].configuration.getTheme();
var documentBody = document.body;
if(theme === HCB) {
documentBody.classList.add("hcb-background");
} else {
documentBody.classList.remove("hcb-background");
}

window.onload =function() {
//Inform parent when loaded to attach handlers for scroll
parent.postMessage("Iframe Loaded Successfully", "*");
};
})();

0 comments on commit 5212a87

Please sign in to comment.