Closed Bug 1371911 Opened 8 years ago Closed 8 years ago

JS errors when AppMenu is not on toolbar

Categories

(Thunderbird :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 55.0

People

(Reporter: Paenglab, Assigned: Paenglab)

References

Details

Attachments

(1 file, 1 obsolete file)

I get JS errors when the Appmenu isn't in the toolbar when I open the view menu or I change to offline mode.
Attached patch noAppMenuErrors.patch (obsolete) — Splinter Review
Check first if the item exists.
Assignee: nobody → richard.marti
Status: NEW → ASSIGNED
Attachment #8876380 - Flags: review?(acelists)
Comment on attachment 8876380 [details] [diff] [review] noAppMenuErrors.patch Review of attachment 8876380 [details] [diff] [review]: ----------------------------------------------------------------- ::: mail/base/content/mail-offline.js @@ +203,5 @@ > */ > updateOfflineUI: function(aIsOffline) > { > document.getElementById('goOfflineMenuItem').setAttribute("checked", aIsOffline); > + if (document.getElementById('appmenu_goOffline')) Please use double quotes for the strings. ::: mail/base/content/mailWindowOverlay.js @@ +191,5 @@ > messagePaneMenuItem.disabled = accountCentralDisplayed; > } > > + if (document.getElementById("appmenu_showMessage")) { > + let messagePaneAppMenuItem = document.getElementById("appmenu_showMessage"); Please swap it like: let messagePaneAppMenuItem = document.getElementById("appmenu_showMessage"); if (messagePaneAppMenuItem && messagePaneAppMenuItem.hidden) .. @@ +204,5 @@ > if (!folderPaneMenuItem.hidden) { // Hidden in the standalone msg window. > folderPaneMenuItem.setAttribute("checked", gFolderDisplay.folderPaneVisible); > } > > let folderPaneAppMenuItem = document.getElementById("appmenu_showFolderPane"); Doesn't this one and other appmenu_* elements below need to be checked for existence too?
(In reply to :aceman from comment #2) > Comment on attachment 8876380 [details] [diff] [review] > noAppMenuErrors.patch > > Review of attachment 8876380 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: mail/base/content/mail-offline.js > @@ +203,5 @@ > > */ > > updateOfflineUI: function(aIsOffline) > > { > > document.getElementById('goOfflineMenuItem').setAttribute("checked", aIsOffline); > > + if (document.getElementById('appmenu_goOffline')) > > Please use double quotes for the strings. mail-offline.js has a mixture of using single- and double quotes. I changed now the whole function block to double quotes. > ::: mail/base/content/mailWindowOverlay.js > @@ +191,5 @@ > > messagePaneMenuItem.disabled = accountCentralDisplayed; > > } > > > > + if (document.getElementById("appmenu_showMessage")) { > > + let messagePaneAppMenuItem = document.getElementById("appmenu_showMessage"); > > Please swap it like: > let messagePaneAppMenuItem = document.getElementById("appmenu_showMessage"); > if (messagePaneAppMenuItem && messagePaneAppMenuItem.hidden) .. Done. > @@ +204,5 @@ > > if (!folderPaneMenuItem.hidden) { // Hidden in the standalone msg window. > > folderPaneMenuItem.setAttribute("checked", gFolderDisplay.folderPaneVisible); > > } > > > > let folderPaneAppMenuItem = document.getElementById("appmenu_showFolderPane"); > > Doesn't this one and other appmenu_* elements below need to be checked for > existence too? I checked all menus and got no additional errors.
Attachment #8876380 - Attachment is obsolete: true
Attachment #8876380 - Flags: review?(acelists)
Attachment #8876393 - Flags: review?(acelists)
Comment on attachment 8876393 [details] [diff] [review] noAppMenuErrors.patch Review of attachment 8876393 [details] [diff] [review]: ----------------------------------------------------------------- Thanks.
Attachment #8876393 - Flags: review?(acelists) → review+
Thanks too.
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 55.0
Regressions: 1576397
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: