-
Notifications
You must be signed in to change notification settings - Fork 8
Informacja o dawno zadanym pytaniu #297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
fac6f34
1c3a13e
657a33a
dd46a93
fa67d49
afce8f1
b3ea532
8d57fa0
e6348bb
ea2ee2d
80ec452
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,16 +18,16 @@ if(placeOfOutdatedQuestionInfo){ | |
| if(questionElemExist){ | ||
| const outdatedInfoContainerClassList = questionElemExist.classList; | ||
|
|
||
| const areThereAnswersForQuestion = !CKEDITOR.instances.a_content ? true : false; | ||
| const areThereAnswersForQuestion = !CKEDITOR.instances.a_content; | ||
|
|
||
|
|
||
|
|
||
| document.querySelector('#q_doanswer').addEventListener('click', ()=>{ | ||
| outdatedInfoContainerClassList.contains('hidden') ? outdatedInfoContainerClassList.remove('hidden') : outdatedInfoContainerClassList.add('hidden'); | ||
| outdatedInfoContainerClassList.toggle('hidden'); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nie
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nie jestem pewny czy to mogłoby zadziałać. Formularz odpowiedzi możemy zamknąć również przyciskiem otwierania odpowiedzi, a nie tylko czerwonym anuluj. Toggle jest tu aby nie było jasno narzucone, którym przyciskiem mamy zamykać formularz
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Faktycznie, przycisk "Odpowiedz" toggluje formularz z edytorem - nie zauważyłem. Więc |
||
| if(areThereAnswersForQuestion){ | ||
| const cancelAnswer = CKEDITOR.instances.a_content.element.$.form.docancel; | ||
| cancelAnswer.addEventListener('click', ()=>{ | ||
| outdatedInfoContainerClassList.contains('hidden') ? outdatedInfoContainerClassList.remove('hidden') : outdatedInfoContainerClassList.add('hidden'); | ||
| outdatedInfoContainerClassList.toggle('hidden'); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nie |
||
| }, {once: true}); | ||
| } | ||
| }) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Czy nie brakuje tutaj drugiej negacji -
!!CKEDITOR.instances.a_content? W obecnej formie, jeślia_contentjest falsy (czyli np. puste pole edytora z odpowiedzią), to wareThereAnswersForQuestionbędzietrue(bo jest pojedyncza negacja), a chyba chcemy odwrotnie. Pisałem o tym w komentarzu.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nie nie brakuje. jeżeli od razu jest wyświetlana instancja CKEditora to wyrażenie zwraca false, ponieważ nie ma przycisku anuluj, więc po co dodawać event listenera do czegoś co nie istnieje?
Trochę się tutaj jednak pomyliłem przy nazywaniu. Powinno to być bardziej coś w stylu
cancelButtonExist.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.