Skip to content

Commit

Permalink
fix #3152 コンテンツをテーブル表示で削除した際に他画面にあるメッセージが表示されない問題を改善
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuring committed Feb 23, 2024
1 parent a61d5d5 commit f35fdec
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 21 deletions.
32 changes: 23 additions & 9 deletions plugins/bc-admin-third/src/js/admin/contents/index_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,39 @@
/**
* コンテンツ一覧(テーブル)
*/
const contentsIndexTable = {

$(function () {

initList();
/**
* mounted
*/
mounted() {
this.initView();
this.registerEvents();
},

/**
* 一覧を初期化
* 表示初期化
*/
function initList() {
$('.btn-copy, .btn-delete, .btn-publish, .btn-unpublish').click(actionClickHandler);
initView() {
// 公開・非公開ボタンの表示設定
$("#ListTable tbody tr .btn-publish").hide();
$("#ListTable tbody tr.unpublish .btn-publish").show();
$("#ListTable tbody tr .btn-unpublish").hide();
$("#ListTable tbody tr.publish .btn-unpublish").show();
}
},

/**
* イベント登録
*/
registerEvents() {
$('.btn-copy, .btn-delete, .btn-publish, .btn-unpublish').click(this.actionClickHandler);
},

/**
* アクションボタンクリック時イベント
* @returns {boolean}
*/
function actionClickHandler() {
actionClickHandler() {
const $target = $(this);
if ($target.attr('data-confirm-message') && !confirm($target.attr('data-confirm-message'))) {
return false;
Expand All @@ -51,6 +62,7 @@ $(function () {
$.bcUtil.showLoader();
}
}).done(function () {
$.bcUtil.showNoticeMessage(bcI18n.commonExecCompletedMessage);
location.reload();
}).fail(function (XMLHttpRequest, textStatus, errorThrown) {
$.bcUtil.showAjaxError(bcI18n.commonExecFailedMessage, XMLHttpRequest, errorThrown);
Expand All @@ -61,4 +73,6 @@ $(function () {
return false;
}

});
}

contentsIndexTable.mounted();
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
* @var array $contents
*/
$this->BcListTable->setColumnNumber(8);
$this->BcBaser->js('admin/contents/index_table.bundle');
$this->BcBaser->js('admin/contents/index_table.bundle', false, [
'defer' => true
]);
?>


Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f35fdec

Please sign in to comment.