sul-dlss-deprecated / universalviewer

The Universal Viewer is a community-developed open source project on a mission to help you share your content with the world
http://universalviewer.io
Other
0 stars 1 forks source link

Replace "X" on modals with Close button #20

Closed ggeisler closed 7 years ago

ggeisler commented 7 years ago

The close icon on the UV modals doesn't feel quite right; it gives the viewer a bit of an unsophisticated feel:

universal_viewer_examples 4

We recommend replacing the current close icon with a close button in the modal itself:

universal_viewer_examples 5

universal_viewer_examples 3

Styling the close button with the Bootstrap styling for btn-default should work fine.

Minor related point: I'd give all the modal buttons a border-radius of 4px or so, just because there are already a lot of sharp corners used in the modal.

mejackreed commented 7 years ago

We think the approach here is to modify Dialogue.ts locally to change how the markup is rendered (and then of course modify styling?). $closeButton seems to be the relevant thing.

mejackreed commented 7 years ago

@aeschylus and I have paired looking into this, and it appears more complex than originally thought. The intent here is to not only add the "Close" text but also change the location of this button. This html syntax would need to be overridden differently in each UV class that uses this. Most of these are *Dialougue classes and the change likely wouldn't be global.

A few ways ahead here:

What is the most viable way?

aeschylus commented 7 years ago

Part of what complicates this is the inability to access the UV's own model of the interface at runtime, or to supply an override class through an externally-maintained set of "plugins", or override objects. The typescript toolchain closes us out of the object hierarchy.

However, if there is a way to do an override (we'd have to hear from @edsilv on that I think), that is a 4th option.

aeschylus commented 7 years ago

The base Dialogue has had a buttons container added and a config option has been added to place the close button in this container. We will need to confirm that the styling and events are working in the following inheriting classes (for personal reference/as a checklist):

Also, adding the close buttons to each of these might imply changes to the styling of other elements around them, like the more info link in the Download dialogue.

aeschylus commented 7 years ago

@edsilv has said we can submit this as a PR to v3 with the config option, then it can be selected in our theme.