/*! * # Fomantic-UI 2.9.0 - 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')() ; $.modal = $.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 = [window,document].indexOf(settings.context) < 0 ? $document.find(settings.context) : $body, isBody = $context[0] === $body[0], $closeIcon = $module.find(selector.closeIcon), $inputs, $allModals, $otherModals, $focusedElement, $dimmable, $dimmer, isModalComponent = $module.hasClass('modal'), element = this, instance = isModalComponent ? $module.data(moduleNamespace) : undefined, ignoreRepeatedEvents = false, initialMouseDownInModal, initialMouseDownInScrollbar, initialBodyMargin = '', tempBodyMargin = '', keepScrollingClass = false, hadScrollbar = false, elementEventNamespace, id, observer, module ; module = { initialize: function() { module.create.id(); if(!isModalComponent) { 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($('