Closed Bug 676991 Opened 8 years ago Closed 8 years ago
Move toolbar print button to utility
The toolbar print button is common across most major components in the suite, yet there is duplicated css and xul code rather than all being in one place. This patch: * Moves the CSS into communicator.css * Moves the xul into utilityOverlay.xul * Removes the now unneeded entities from editorOverlay.dtd, navigator.dtd and messenger.dtd * printButton.label/tooltip has been left in each component as the tooltip various between components
Comment on attachment 551205 [details] [diff] [review] Consolidate the code >- <toolbarbutton id="button-print" >- class="toolbarbutton-1" >- type="menu-button" > label="&printButton.label;" > observes="button_print" >- oncommand="goDoCommand('cmd_print')" >- tooltiptext="&printButton.tooltip;"> >- <menupopup id="printMenu" >- onpopupshowing="goUpdateCommand('cmd_printpreview');"> >- <menuitem id="button-printMenu" >- label="&printCmd.label;" >- accesskey="&printCmd.accesskey;" >- default="true"/> >- <menuitem id="button-printPreviewMenu" >- label="&printPreviewCmd.label;" >- accesskey="&printPreviewCmd.accesskey;" >- command="cmd_printpreview"/> >- </menupopup> >- </toolbarbutton> So, there's a small problem with switching from command="cmd_printpreview" to observes="cmd_printpreview", and that's because command= causes the command event to fire on the command element, but using observes= causes the command event to fire on the menuitem, where it bubbles up to the toolbarbutton, thus causing both a preview and a print at the same time :-(
Changes since last version: * Now depends on bug 21432 which gives print preview to Composer so using command instead of observes.
Comment on attachment 553967 [details] [diff] [review] Now with less observing [Checked in: Comment 5] >-<!ENTITY printPreviewCmd.label "Print Preview"> >-<!ENTITY printPreviewCmd.accesskey "v"> Bah, it was hardly worth adding them ;-)
Attachment #553967 - Flags: review?(neil) → review+
Comment on attachment 553967 [details] [diff] [review] Now with less observing [Checked in: Comment 5] Asking for additional review due to changes in some shared files.
Attachment #553967 - Flags: review?(mbanner)
Attachment #553967 - Flags: review?(mbanner) → review+
Comment on attachment 553967 [details] [diff] [review] Now with less observing [Checked in: Comment 5] http://hg.mozilla.org/comm-central/rev/a508ab7862d2
Attachment #553967 - Attachment description: Now with less observing → Now with less observing [Checked in: Comment 5]
You need to log in before you can comment on or make changes to this bug.