Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[4.0.0-beta.1] Replacements for 'cp.entries.edit.details' hook and draftEditor.on('createProvisionalDraft') js event

オープン
#346 コメント 3 件 リアクション 1 件 担当者 1 名 GitHub で見る

@mattstein がすでに取り組んでいます。

2022年3月11日 から。

評価

この issue はまだ評価されていません。

説明

Bug
Description

Not really a bug, but maybe some missing info in the upgrade guides.

Upgrading plugins/modules went very smoothly so far, just one thing i couldn't figure out in entries edit pages:

In 3.7, we are adding custom buttons to the end of the sidebar via the now removed hook cp.entries.edit.details.

image

Could only find the Element::EVENT_DEFINE_SIDEBAR_HTML event, which places the added html somewhere in the middle of the sidebar. Is there a possibility/event to add the html to the very end of the sidebar?

The compare button is hidden by default in 'Current' entries, and gets enabled when a provisional draft is created:

window.draftEditor.on('createProvisionalDraft', function() {
    newDraftId = window.draftEditor.settings.draftId
    ...
     $('#draft-new').css('display', '')
});

This obviously does not work anymore, is there another js event we could hook into that gets fired when a provisional draft is created and contains the new draftId?

(If not, this is a FR :-)

Additional info
  • Craft version: 4.0.x-dev
  • PHP version: 8.0.15
  • Database driver & version:
  • Plugins & versions: none
主要言語
JavaScript
スター
43
フォーク
160
平均マージ
3時間 57分
マージ済み PR(30日)
3

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

craftcms/docs のほかの issue

craftcms/docs の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。