Skip to content

Commit

Permalink
#88 restoring init() js, if available
Browse files Browse the repository at this point in the history
  • Loading branch information
tracend committed Jun 27, 2013
1 parent 1ba32e8 commit 33d12af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/helpers/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ function createClient( $dom ){

}
// render the global client vars
$client .= 'Object.extend(KISSCMS, '. json_encode_escaped( $GLOBALS['client'] ) .');';
$client .= 'require.config( KISSCMS["require"] );';

$client = $this->trimWhitespace($client);
// #87 not caching client vars as a file
Expand Down
3 changes: 1 addition & 2 deletions app/views/main/foot.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
<![endif]-->

<script type="text/javascript" data-type="client">
Object.extend(KISSCMS, <?=json_encode_escaped( $GLOBALS['client'] )?>);
require.config( KISSCMS.require );
Object.extend(KISSCMS, {"require":{"callback": function(){ if(typeof init != "undefined") init(); } }});
</script>

<script id="require-main" type="text/javascript" data-main="<?=url("/client")?>" src="<?=url("/js/libs/require.js")?>" defer="defer"></script>

0 comments on commit 33d12af

Please sign in to comment.