mirror of
https://github.com/Mibew/mibew.git
synced 2025-01-31 13:24:41 +03:00
Initialize "thread_log" client side app from controller
This commit is contained in:
parent
aee1aa6904
commit
d92b88b65a
@ -201,12 +201,20 @@ class HistoryController extends AbstractController
|
||||
'sanitize_message',
|
||||
$thread->getMessages(false, $last_id)
|
||||
);
|
||||
$page['threadMessages'] = json_encode($messages);
|
||||
|
||||
$page['title'] = getlocal("Chat log");
|
||||
|
||||
$page = array_merge($page, prepare_menu($operator, false));
|
||||
|
||||
$this->getAssetManager()->attachJs('js/compiled/thread_log_app.js');
|
||||
$this->getAssetManager()->attachJs(
|
||||
sprintf(
|
||||
'jQuery(document).ready(function(){Mibew.Application.start(%s);});',
|
||||
json_encode(array('messages' => $messages))
|
||||
),
|
||||
\Mibew\Asset\AssetManagerInterface::INLINE,
|
||||
1000
|
||||
);
|
||||
|
||||
return $this->render('history_thread', $page);
|
||||
}
|
||||
|
@ -1,15 +1,4 @@
|
||||
{{#extends "_layout"}}
|
||||
{{#override "head"}}
|
||||
<!-- Start application -->
|
||||
<script type="text/javascript"><!--
|
||||
jQuery(document).ready(function(){
|
||||
Mibew.Application.start({
|
||||
messages: {{{threadMessages}}}
|
||||
});
|
||||
});
|
||||
//--></script>
|
||||
{{/override}}
|
||||
|
||||
{{#override "content"}}
|
||||
{{l10n "This page displays chat details and content."}}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user