/*! * # Fomantic-UI 2.9.2 - Flyout * https://github.com/fomantic/Fomantic-UI/ * * * Released under the MIT license * https://opensource.org/licenses/MIT * */ (function ($, window, document) { 'use strict'; function isFunction(obj) { return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } window = window !== undefined && window.Math === Math ? window : globalThis; $.fn.flyout = function (parameters) { var $allModules = $(this), $window = $(window), $document = $(document), $html = $('html'), $head = $('head'), $body = $('body'), moduleSelector = $allModules.selector || '', time = Date.now(), performance = [], query = arguments[0], methodInvoked = typeof query === 'string', queryArguments = [].slice.call(arguments, 1), returnedValue ; $allModules.each(function () { var settings = $.isPlainObject(parameters) ? $.extend(true, {}, $.fn.flyout.settings, parameters) : $.extend({}, $.fn.flyout.settings), selector = settings.selector, className = settings.className, namespace = settings.namespace, fields = settings.fields, regExp = settings.regExp, error = settings.error, eventNamespace = '.' + namespace, moduleNamespace = 'module-' + namespace, $module = $(this), $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), $style, isFlyoutComponent = $module.hasClass('flyout'), element = this, instance = isFlyoutComponent ? $module.data(moduleNamespace) : undefined, ignoreRepeatedEvents = false, isBody = $context[0] === $body[0], initialBodyMargin = '', tempBodyMargin = '', hadScrollbar = false, elementNamespace, id, observer, observeAttributes = false, currentScroll, module ; module = { initialize: function () { module.debug('Initializing flyout', parameters); module.create.id(); if (!isFlyoutComponent) { module.create.flyout(); if (!isFunction(settings.onHidden)) { settings.onHidden = function () { module.destroy(); $module.remove(); }; } if (!settings.autoShow) { settings.autoShow = true; } } $module.addClass(settings.class); if (settings.title !== '') { $module.find(selector.header).html(module.helpers.escape(settings.title, settings.preserveHTML)).addClass(settings.classTitle); } if (settings.content !== '') { $module.find(selector.content).html(module.helpers.escape(settings.content, settings.preserveHTML)).addClass(settings.classContent); } if (module.has.configActions()) { var $actions = $module.find(selector.actions).addClass(settings.classActions); if ($actions.length === 0) { $actions = $('
', { class: className.actions + ' ' + (settings.classActions || '') }).appendTo($module); } else { $actions.empty(); } settings.actions.forEach(function (el) { var 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($('