From 0740de88774bb3171b0badb2481aea5bfe07461a Mon Sep 17 00:00:00 2001 From: Marco 'Lubber' Wienkoop Date: Tue, 20 Sep 2022 15:03:03 +0200 Subject: [PATCH] fix(sidebar,flyout,modal): missing identical features and fixes flyout features (all adopted from modal): - moved many values into LESS variables - a11y: aria labels, tab focus trap, close icon focussable and activateable via space key - autofocus setting,restoreFocus setting - fetch esc key to close flyout by new via keyBoardShortcuts setting - basic actions, basic header - left actions - center aligned header, content, actions - blurring setting flyout fixes: - smooth fadeout of dimmer (was hard removing the dimmer without any transition on close) - temp flyouts have to be put before pusher in dom to avoid auto pusher wrap when not necessary Sidebar fixes: - smooth fadeout of dimmer (was hard removing the dimmer without any transition on close) Sidebar features (adopted from modal): - blurring setting modal fixes: - basic action on inverted dimmer --- src/definitions/modules/flyout.js | 246 +++++++++++++++--- src/definitions/modules/flyout.less | 182 ++++++++----- src/definitions/modules/modal.less | 6 +- src/definitions/modules/sidebar.js | 32 ++- src/definitions/modules/sidebar.less | 11 + .../default/globals/variation.variables | 8 + src/themes/default/modules/flyout.variables | 57 +++- src/themes/default/modules/modal.variables | 4 +- src/themes/default/modules/sidebar.variables | 5 +- 9 files changed, 440 insertions(+), 111 deletions(-) diff --git a/src/definitions/modules/flyout.js b/src/definitions/modules/flyout.js index b8ca1001fa..8d44b79229 100644 --- a/src/definitions/modules/flyout.js +++ b/src/definitions/modules/flyout.js @@ -68,8 +68,10 @@ $.flyout = $.fn.flyout = function(parameters) { moduleNamespace = 'module-' + namespace, $module = $(this), - $context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $body, - $close = $module.find(selector.close), + $context = [window,document].indexOf(settings.context) < 0 ? $document.find(settings.context) : $body, + $closeIcon = $module.find(selector.close), + $inputs, + $focusedElement, $flyouts = $module.children(selector.flyout), $pusher = $context.children(selector.pusher), @@ -88,6 +90,7 @@ $.flyout = $.fn.flyout = function(parameters) { elementNamespace, id, + observer, currentScroll, transitionEvent, @@ -99,6 +102,7 @@ $.flyout = $.fn.flyout = function(parameters) { initialize: function() { module.debug('Initializing flyout', parameters); + module.create.id(); if(!isFlyoutComponent) { module.create.flyout(); if(!$.isFunction(settings.onHidden)) { @@ -127,13 +131,14 @@ $.flyout = $.fn.flyout = function(parameters) { } settings.actions.forEach(function (el) { var - icon = el[fields.icon] ? '' : '', + icon = el[fields.icon] ? '' : '', text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML), cls = module.helpers.deQuote(el[fields.class] || ''), click = el[fields.click] && $.isFunction(el[fields.click]) ? el[fields.click] : function () {} ; $actions.append($('