Skip to content

Commit

Permalink
⚡ Object.extend fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
tracend committed Mar 19, 2024
1 parent af617e7 commit aa20eb7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/helpers/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,10 @@ function setupClient(){
}

function createClient( $dom ){
$client = "";
$client = 'if(typeof Object.extend == "undefined") Object.extend = Object.assign;if(!KISSCMS) var KISSCMS = {};';
// see if there is any "loose" source in the client
if( !empty($GLOBALS['client']["_src"]) ) {
$client = $GLOBALS['client']["_src"];
$client .= $GLOBALS['client']["_src"];
unset($GLOBALS['client']["_src"]);
}
// if in debug, remove any scripts in the require.js paths
Expand All @@ -291,7 +291,7 @@ function createClient( $dom ){

}
// render the global client vars
$client .= 'Object.extend(KISSCMS, '. json_encode_escaped( $GLOBALS['client'] ) .');';
$client .= 'Object.assign(KISSCMS, '. json_encode_escaped( $GLOBALS['client'] ) .');';
if( $this->useRequire() ){
$client .= 'if(typeof require != "undefined") require.config( KISSCMS["require"] );';
}
Expand Down

0 comments on commit aa20eb7

Please sign in to comment.