Skip to content

Commit

Permalink
增加 LA.ready 函数
Browse files Browse the repository at this point in the history
  • Loading branch information
jqhph committed Jan 8, 2019
1 parent e1383c8 commit 7ab9e52
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
4 changes: 0 additions & 4 deletions resources/views/index-footer.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
@endif
</div>

<script>
function LA() {}
LA.token = "{{ \Swoft\Support\SessionHelper::wrap() ? \Swoft\Support\SessionHelper::wrap()->token() : '' }}";
</script>
{!! html_js('@admin/layer/layer.js') !!}
{!! html_js('@admin/swoft-admin/main.js') !!}
</body>
Expand Down
17 changes: 16 additions & 1 deletion resources/views/index-header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,22 @@
<style>.content-wrapper,.sidebar-mini.sidebar-collapse .content-wrapper{margin-left:0!important}</style>
@endif
</head>

<script>
function LA() {}
LA.token = "{{ \Swoft\Support\SessionHelper::wrap() ? \Swoft\Support\SessionHelper::wrap()->token() : '' }}";
/**
*
* @param callback
* @returns {*}
*/
LA.ready = function (callback) {
if (typeof LA.pjaxresponse == 'undefined') {
return $(callback);
}
return $(document).one('pjax:script', callback);
};
</script>
<body class="swoft-admin-body hold-transition {{config('admin.skin')}} {{join(' ', config('admin.layout'))}}">
<div class="wrapper">

Expand Down
2 changes: 2 additions & 0 deletions resources/views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@

@if (!is_pjax_request())
@include('admin::index-footer')
@else
<script>LA.pjaxresponse = 1;</script>
@endif

0 comments on commit 7ab9e52

Please sign in to comment.