mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 00:30:44 +00:00
a51fbbb300
Problem: When the toolbar is created twice with the same config object, the second time around the tools are still bound to the old surface Reason: The tool config is overwritten such that symbolic names of tools are replaced with instances of tools, bound to a specific surface. The second time around, the creation fails (silently in a try-catch) and then the already translated list of tools is used to create a new toolbar filled with old tools still bound to the wrong surface. Solution: Leave the config object alone, and instead build a new list of tool instances while iterating through tool names. Bonus: Don't fail silently. Using a try-catch to detect whether a requested tool is supported masks other errors, and is evil. Instead, just do a lookup and skip tools in which the lookup's result is falsey. Change-Id: Ic43ec29173e556592bb3db9399ff83787e0a6857 |
||
---|---|---|
.. | ||
actions | ||
dialogs | ||
elements | ||
inspectors | ||
layouts | ||
styles | ||
tools | ||
widgets | ||
ve.ui.Action.js | ||
ve.ui.ActionFactory.js | ||
ve.ui.CommandRegistry.js | ||
ve.ui.Context.js | ||
ve.ui.Dialog.js | ||
ve.ui.DialogFactory.js | ||
ve.ui.Frame.js | ||
ve.ui.Inspector.js | ||
ve.ui.InspectorFactory.js | ||
ve.ui.js | ||
ve.ui.Layout.js | ||
ve.ui.Surface.js | ||
ve.ui.SurfaceToolbar.js | ||
ve.ui.Tool.js | ||
ve.ui.Toolbar.js | ||
ve.ui.ToolFactory.js | ||
ve.ui.ToolGroup.js | ||
ve.ui.Trigger.js | ||
ve.ui.TriggerRegistry.js | ||
ve.ui.Widget.js | ||
ve.ui.Window.js | ||
ve.ui.WindowSet.js |