- Modals now remove their shades from the DOM when destroyed.
- HUDs now remove their containers and shades from the DOM when destroyed.
- Improved ESC key handling for menus.
- Context menus and disclosure menus now trigger
show
andhide
events.
- Added
Garnish.DisclosureMenu
, for cases where a menu is used to show/hide content, as opposed to acting like a form<select>
.
- Renamed
Garnish.Menu
toGarnish.CustomSelect
. (Garnish.Menu
still exists as a deprecated alias.)
Garnish.NiceText
will now submit the closest form when Ctrl/Command + Return is pressed. (craftcms/cms#7999)
- Fixed a JavaScript error that could occur with
Garnish.Select
.
Garnish.Select
now prevents the browser from scrolling to newly-focused items unless the focus was given via a keyboard event. (craftcms/cms#7940)
- Added
Garnish.NiceText.charsLeftHtml()
, which can be overridden to customize the HTML used to display the remaining allowed characters. (#8)
Garnish.Menu
options are now selectable via the Space key.
- Removed
Garnish.Pill
. (craftcms/cms#7705)
- Fixed a bug where
Garnish.isCtrlKeyPressed()
would returnfalse
on Windows browsers if bothev.ctrlKey
andev.altKey
were bothtrue
.
- Improved
Garnish.ShortcutManager
.
- Fixed an issue where
Garnish.MenuBtn
didn’t have the proper ARIA attributes.
- Fixed a “Can’t remove the base layer.” error that could be thrown if a modal, HUD, or menu was hidden before it was shown.
- Added
Garnish.ShortcutManager
. - Added the
hideOnEsc
andhideOnShadeClick
settings toGarnish.HUD
.
- Deprecated
Garnish.EscManager
. UseGarnish.ShortcutManager
instead.
- Fixed a bug where drag helpers weren’t getting set to the correct width and height if the dragged element had
box-sizing: border-box
.
Garnish.Menu
objects now trigger ashow
event when the menu in shown.
- It’s now possible to pass a
Garnish.Menu
object as a second argument when creating a newGarnish.MenuBtn
object. - Menus no longer close automatically when the trigger element is blurred, if the focus is changed to an input within the menu.
- Fixed a bug where HUDs could be positioned incorrectly when first opened. (craftcms/cms#5004)
- Fixed a bug where the scroll container could be changed when selecting
Garnish.Select
items, if the scroll container was something besides the window. (craftcms/cms#3762)
- Fixed a bug where it wasn’t possible to close HUDs on computers with touchscreens. (craftcms/cms#3343)
- Fixed a bug where elements with
overflow: auto
could not be scrolled while dragging an element over them. (craftcms/cms#2340)
- Fixed a bug where HUDs could end up at the top of the page if closed and reopened without scrolling or resizing the window. (craftcms/cms#3220)
- Fixed an infinite loop bug that could occur if a modal had a nested element with a
resize
event listener.
- Fixed a JavaScript error that occurred when removing event listeners via
Garnish.Base::removeListener()
orremoveAllListeners()
.
- Fixed a bug where Garnish.Select instances would try to reestablish window focus on the virtually focused item on self-destruct. (craftcms/cms#2964)
- Menus that are too tall to fit in the current viewport are now scrollable. (craftcms/cms#2942)
- Menus now reposition themselves as the window is scrolled.
- Fixed a bug where HUDs weren’t automatically resizing/repositioning themselves.
- Added support for class-level events via
Garnish.on()
andGarnish.off()
.
Garnish.HUD
instances are now accessible via.data('hud')
on their container element.
Garnish.Select
will no longer toggle focus on an item whenspacebar
is pressed, if theshift
key is down.Garnish.Select
will now trigger afocusItem
event when an item is focused.Garnish.Select
will now keep track of the focused item via a$focusedItem
property.- Event handlers registered with
Garnish.addListener()
can now returnfalse
to cancel the event.
- Fixed a bug where HUDs could get themselves into an infinite repositioning loop.
- Stability improvements.
- Fixed a bug where HUDs where briefly showing up in the top left corner of the window before getting repositioned.
- Fixed a potential infinite HUD resize loop in IE11.
- Fixed a bug where NiceText objects’ staging areas were getting a
&nbps;
entity appended rather than
. (AugustMiller)
- Modals no longer automatically update their position when they change size.
- Fixed a bug where modals would get caught in infinite resize handling loops.
- Fixed a bug where modals could be initialized with the wrong size when fading in.
- Modals and HUDs now trigger
updateSizeAndPosition
events when their size/position changes.
- Modals now automatically update their position when they change size.
- Fixed a bug where an infinite event loop could be caused when opening an HUD.
- Fixed a “Garnish is not defined” error.
- Garnish no longer has jQuery as a Bower dependency.
- Fixed a bug where HUDs weren’t factoring in window/trigger padding when calculating the max size of the HUD alongside the trigger element
- Relaxed the dependencies’ version requirements
- Removed touch support from
Garnish.BaseDrag
- Added touch support to
Garnish.BaseDrag
- Updated gulp-sourcemaps dependency to 1.9.1
- HUDs now have their size and position updated on window resize
- Added bower as an NPM dependency
- Added element-resize-detector 1.1.7 bower dependency
- Added jquery 2.2.1 bower dependency
- Added velocity 1.2.3 bower dependency
- Added jquery-touch-events 1.0.5 bower dependency
- Added gulp docs task for generating documentation with JSDoc
- Fixed a bug where the listener on the
click
event on the HUD’s$shade
was not working properly with ataphold
event defined on the same element
- Fixed a bug where NiceText wasn’t accounting for trailing newlines when approximating the input height
- Fixed a bug where clicking on a Menu option could hide the menu before the option had a chance to activate
- Improved NiceText’s input height approximation logic
- Fixed a bug where NiceText was not ensuring the associated input was still visible before recalculating its height