Closed Bug 1382667 Opened 7 years ago Closed 7 years ago

Implement an onBeforeCommand function for CustomizableUI that will run before the command is executed

Categories

(Firefox :: Toolbars and Customization, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
Firefox 56
Iteration:
56.3 - Jul 24
Tracking Status
firefox56 --- fixed

People

(Reporter: jaws, Assigned: jaws)

References

Details

(Whiteboard: [reserve-photon-animation])

Attachments

(1 file)

Some commands may want to change the appearance of their toolbarbutton before the associated command is executed or view is opened.

With the onBeforeCommand function, the widget will be able to adapt its UI before attributes are set on the button ([open="true"] is set on [type="view"] widgets for example).
Iteration: --- → 56.3 - Jul 24
Flags: qe-verify?
Priority: -- → P1
Comment on attachment 8888303 [details]
Bug 1382667 - Implement an onBeforeCommand function for CustomizableUI that will run before the command is executed.

https://reviewboard.mozilla.org/r/159258/#review164924

::: browser/components/customizableui/CustomizableUI.jsm:3302
(Diff revision 2)
>     *                  passing the document from which it was removed. This is
>     *                  useful especially for 'view' type widgets that need to
>     *                  cleanup after views that were constructed on the fly.
> +   * - onBeforeCommand(aEvt): A function that will be invoked when the user
> +   *                          activates the button but before the command
> +   *                          is evaluating. Useful if code needs to run to

Nit: evaluated.

Might also be useful to clarify this also applies for view widgets that show a subview.
Attachment #8888303 - Flags: review?(gijskruitbosch+bugs) → review+
Pushed by jwein@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/687efdbdcd84
Implement an onBeforeCommand function for CustomizableUI that will run before the command is executed. r=Gijs
Flags: qe-verify? → qe-verify-
https://hg.mozilla.org/mozilla-central/rev/687efdbdcd84
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 56
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: