Steps to reproduce:
put a cal.ERROR() or a LOG() just inside the month view relayout function:
switch to the month view; change month or scroll the month view.
In the error console you can see that the relayout is being called twice.
The same doesn't happen nor for the multiweek view that uses the same relayout, neither for the others views that use the relayout in calendar-multiday-view.xml file.
Created attachment 667337 [details] [diff] [review]
Inside the function goToDay ("calendar-month-view" binding) there is a call to the function showDate()
that is useless because repeats two actions already executed in the function (included the second call to the relayout).
In another way we could delete the lines above and below the call to showDate() but in this way the code is similar to the others "goToDay" functions in the file.
Comment on attachment 667337 [details] [diff] [review]
(In reply to Decathlon from comment #1)
> In another way we could delete the lines above and below the call to
> showDate() but in this way the code is similar to the others "goToDay"
> functions in the file.
I'd actually prefer removing the other two lines, since its exactly what showDate does. If the other functions do the same thing, then those could be changed too.
Created attachment 687498 [details] [diff] [review]
patch with showDate()
This patch uses showDate().
(In reply to Philipp Kewisch [:Fallen] from comment #2)
> I'd actually prefer removing the other two lines, since its exactly what
> showDate does. If the other functions do the same thing, then those could be
> changed too.
Using showDate() in the other cases is not directly possible without changing his implementation in the calICalendarView interface.
Actually the showDate() methods seem never used, apart from the month-view case considered in this patch (don't know about adds-on):
where the line 226 is the one involved in this patch. The only other line which uses showDate() is
but actually it appears inside the function goToDay() that is overlayed by the the respective goToDay() functions inside the extended bindings for each views (file calendar-views.xml) and no one uses showDate():
even the showDate() inside calendar-multiday-view.xml (that is a bit more elaborated) is never used:
if I've tracked it correctly, it has been added with bug 293549 but in bug 319701 the calls to showDate() have been changed with calls to goToDay() functions.
All the functions "goToDay()", for all the view types, finish with the couple of instructions:
this.selectedDay = date3;
that should be suitable to build a showDate() function like that one used in month-view, but the implementation in the calICalendarView interface should be changed in order to accept three parameters instead of only one. (Maybe should the calICalendarView interfce have a goToDay() element instead of a showDate() one ?)
Philipp, what's your opinion? It's worth trying to sort out showDate() functions or do I have simply to check-in the patch?
I think the patch can be pushed anyway in the repository.
I leave the bug open if we want to dig into the showDate() functions (see comment #3), otherwise we can close it as it is.
Pushed to comm-central changeset 769d60c09681
Philipp, when you have time take a look to comment #3 and let me know your decision.
Its not that important, lets close this bug as is :-) Thanks for investigating!