Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/restore button inheritability #1096

Merged
merged 2 commits into from Feb 15, 2019

Conversation

werrolf
Copy link
Contributor

@werrolf werrolf commented Feb 15, 2019

The purpose of the Mapbender Button is to toggle Elements on and off. Doing this properly can be a complex task.

Some Elements that have nothing at all to do with controlling other Elements are seen to inherit from Button in both the PHP and JavaScript worlds. Most commonly so they blend into the toolbar visually without trying to reinvent the markup for that, and to get the base functionality of a toggling highlight.

Recent changes to the Button as a control device for other Elements have posed compatibility issues for those "I just want to look like a Button" non-controlling Elements.

To resolve this conflict of goals, the Button JavaScript widget has been split, offering a plain, just-for-looks button under the old name mapbender.mbButton, while spinning off all functionality related to Element control into a new mapbender.mbControlButton.

The decision which to initialize is based on inheritance:

  • If the Button is just the Button, it will be initialized as an mbControlButton
  • If the Button is a child class of the Button, it will be initialized as an mbButton
    NOTE: of course, any PHP child class of the Button can override get getWidgetName method and thus overrule this logic. We expect most existing Button children already do this anyway.

@werrolf werrolf merged commit 9960907 into release/3.0.7 Feb 15, 2019
@werrolf werrolf deleted the fix/restore-button-inheritability branch February 15, 2019 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant