Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#346 3 commenti 1 reazione 1 assegnatario Vedi su GitHub

@mattstein ci sta già lavorando.

Dal 11/3/2022.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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
Lingua principale
JavaScript
Stelle
43
Fork
160
Merge medio
3h 57m
PR unite (30g)
3

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di craftcms/docs

Tutte le issue di craftcms/docs

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.