/*! * # Fomantic-UI 2.8.8 - Modal * http://github.com/fomantic/Fomantic-UI/ * * * Released under the MIT license * http://opensource.org/licenses/MIT * */ ;(function ($, window, document, undefined) { 'use strict'; $.isFunction = $.isFunction || function(obj) { return typeof obj === "function" && typeof obj.nodeType !== "number"; }; window = (typeof window != 'undefined' && window.Math == Math) ? window : (typeof self != 'undefined' && self.Math == Math) ? self : Function('return this')() ; $.fn.modal = function(parameters) { var $allModules = $(this), $window = $(window), $document = $(document), $body = $('body'), moduleSelector = $allModules.selector || '', time = new Date().getTime(), performance = [], query = arguments[0], methodInvoked = (typeof query == 'string'), queryArguments = [].slice.call(arguments, 1), requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || function(callback) { setTimeout(callback, 0); }, returnedValue ; $allModules .each(function() { var settings = ( $.isPlainObject(parameters) ) ? $.extend(true, {}, $.fn.modal.settings, parameters) : $.extend({}, $.fn.modal.settings), selector = settings.selector, className = settings.className, namespace = settings.namespace, fields = settings.fields, error = settings.error, eventNamespace = '.' + namespace, moduleNamespace = 'module-' + namespace, $module = $(this), $context = $(settings.context), $close = $module.find(selector.close), $allModals, $otherModals, $focusedElement, $dimmable, $dimmer, element = this, instance = $module.hasClass('modal') ? $module.data(moduleNamespace) : undefined, ignoreRepeatedEvents = false, initialMouseDownInModal, initialMouseDownInScrollbar, initialBodyMargin = '', tempBodyMargin = '', elementEventNamespace, id, observer, module ; module = { initialize: function() { if(!$module.hasClass('modal')) { module.create.modal(); if(!$.isFunction(settings.onHidden)) { settings.onHidden = function () { module.destroy(); $module.remove(); }; } } $module.addClass(settings.class); if (settings.title !== '') { $module.find(selector.title).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($('