Closed (fixed)
Project:
Office Hours
Version:
8.x-1.1
Component:
Code - widget
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 Oct 2018 at 13:22 UTC
Updated:
21 Jun 2019 at 09:03 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mayaslatinek commentedThis patch fixes this issue. But from looking the code it seems that this was intentional, yet it's a bit confusing as to why. If anyone could elaborate on this, please. Also, thinking forward, shouldn't the remove button be present at all times?
Comment #3
johnvHmm,
i cannot reproduce your error. Can you send a screen shot?
Perhaps you are confused by the following limiting setting: 'Number of time slots per day' in the field settings.
Regarding the 'Remove' link. It is present for all existing lines. Indeed not for lines you added during a page session. Perhaps it can be added. in a new issue.
Comment #4
mayaslatinek commentedWhen you enter values on Monday for example and then click on copy from previous for Tuesday, it copies the values but removes the add time slot option.
Comment #5
johnvA picture speaks 100 words!
However, still cannot reproduce your error.
IMO the line in your patch hides the 'Add time slot', then shows it again in some situations.
Comment #6
mayaslatinek commentedI did some more testing on this and figured out that when you have the maximum time slots per day set to 2 and click copy from previous (you copy only one slot from previous, if you copy 2 slots it works fine) it hides the option on the current to add one more slot (when you save and come back to edit the form, add time slot appears). If you have maximum time slots per day set to more it works fine. I’ve made a new patch, tested it for 2 and more time slots per day and it works fine on my end.
I don’t know why you can’t reproduce this @johnv but it happens on my end constantly. Please test this.
Comment #7
johnvI can now repeat your error. Your patch did not fix it for me.
I am very basic in JS, but i think we must reuse the function show_time_slot().
BTW, do you also get a JS error on an edit-page about e.preventDefault(); (with or without the patch)?
Comment #8
mayaslatinek commentedI don’t get any errors on the edit page
The next() function is problematic I think because the selector in place selects the whole day and the first slot of the next day, it then takes that first slot of the next day and goes by it, so the add link of the current stays hidden
The show time slot function is bound to the add time slot link and as I can see it has nothing to do with showing of the add time slot link (on click it shows a slot, not the link), the link hides when you click copy from previous and everything for it happens in the function for copy so I think the problem is there (also the last patch I uploaded solves this issue for me), but please correct me if you find the problem elsewhere.
Could you make a screenshot or something so that I can see what happens on your end?
Comment #9
johnvPlease test attached patch.
Your analysis is correct.
Attached patch includes your change, but also removes duplicate code. (and some code standards)
Comment #11
johnvCommitted.
Comment #13
johnv