Closed Bug 286841 Opened 20 years ago Closed 20 years ago

Minimonth showMonth is called twice when month changes

Categories

(Calendar :: Sunbird Only, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gekacheka, Assigned: mostafah)

References

()

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: 

Minimonth showMonth is called twice whenever displayed month changes.

The methods advanceMonth, switchMonth, and switchYear all set this.value and
call showMonth, but this.value is a property whose onSet handler calls update
which calls showMonth, so those methods should not make a duplicate call to
showMonth.  

Those methods also clear mSelected's selected property, but showMonth also does
that.  

Finally, those methods all call the onmonthchanged handler, but show month could
detect changed months and do that as well, eliminating more duplicated code.

Reproducible: Always

Steps to Reproduce:
(patch -l -p 2 -i file.patch)

Removes redundant calls from advanceMonth, switchMonth, switchYear.
this.mEditorDate is now set ONLY in showMonth.	Always set to 1st of month.
showMonth also handles removing selected property from mSelected.
showMonth also detects month change and calls onmonthchange handler.

Tested on sunbird0.2branch MozCalendar extension on Moz1.8b1.
Attachment #177948 - Attachment filename: bug264150MinimonthShowMonthOnce.patch → bug286841MinimonthShowMonthOnce.patch
Blocks: 264150
Attachment #177948 - Flags: first-review?(mostafah)
(patch -l -p 2 -i file.patch)

Updated patch for trunk.

Note:  only clicking a date changes the value.	Advance month does not change
selected date, so user can look at next month without triggering onchange
listeners, which could change the main calendar grid view.
Attachment #177948 - Attachment is obsolete: true
Attachment #182892 - Flags: first-review?
Attachment #177948 - Flags: first-review?(mostafah)
Attachment #182892 - Flags: first-review? → first-review?(andrew)
Comment on attachment 182892 [details] [diff] [review]
minimonth.xml month change methods: Remove duplicate calls (trunk)

Marking r+ for woo.
Attachment #182892 - Flags: first-review?(andrew) → first-review+
patch checked in
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
QA Contact: gurganbl → sunbird
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: