{"version":3,"sources":["popup.js"],"names":["$","window","document","undefined","Math","self","Function","fn","popup","parameters","returnedValue","$allModules","this","$document","$window","$body","moduleSelector","selector","hasTouch","time","Date","getTime","performance","query","arguments","methodInvoked","queryArguments","slice","call","each","$popup","$offsetParent","documentObserver","elementNamespace","id","module","settings","isPlainObject","extend","className","error","metadata","namespace","eventNamespace","moduleNamespace","$module","$context","context","$scrollContext","scrollContext","$boundary","boundary","$target","target","searchDepth","triedPositions","openedWithTouch","element","instance","data","initialize","debug","createID","bind","events","exists","preserve","create","observeChanges","instantiate","verbose","MutationObserver","event","documentChanged","observe","childList","subtree","refresh","eq","inline","nextAll","addClass","loading","get","offsetParent","removeClass","movePopup","has","detach","appendTo","is","variation","set","reposition","position","destroy","disconnect","removePopup","clearTimeout","hideTimer","showTimer","unbind","close","removeData","start","delay","show","setTimeout","end","hide","touchstart","resize","visible","mutations","forEach","mutation","removedNodes","node","find","length","hideGracefully","isInDOM","contains","documentElement","inPopup","closest","html","title","content","templates","activator","insertAfter","hoverable","onCreate","next","random","toString","substr","toggle","hidden","callback","transition","active","dropdown","onShow","save","conditions","exclusive","hideAll","animate","animating","onHide","remove","restore","filter","onRemove","cache","attr","removeAttr","supports","svg","SVGGraphicsElement","isFunction","animation","queue","duration","onComplete","onVisible","noTransition","reset","onHidden","change","popupOffset","offset","calculations","screen","targetElement","isWindow","targetPosition","screenPosition","top","left","scroll","scrollTop","scrollLeft","width","outerWidth","height","outerHeight","margin","parent","setFluidWidth","fluid","container","parseInt","getComputedStyle","getPropertyValue","rtl","bottom","right","startEvent","on","scrollEvent","endEvent","distanceFromBoundary","parentNode","$node","is2D","css","isStatic","isHTML","positions","top left","top center","top right","bottom left","bottom center","bottom right","left center","right center","nextPosition","split","verticalPosition","horizontalPosition","opposite","adjacent","center","backup","adjacentsAvailable","oppositeTried","adjacentTried","prefer","join","notFound","distanceAway","positioning","replace","match","maxSearchDepth","lastResort","invalidPosition","offstage","cannotPlace","attempts","onUnplaceable","fluidWidth","hideOnScroll","one","closable","off","direction","distance","jitter","push","hasClass","setting","name","value","internal","silent","log","prototype","console","info","apply","message","currentTime","executionTime","previousTime","Name","Arguments","Element","Execution Time","timer","display","totalTime","index","group","table","groupCollapsed","groupEnd","invoke","passedArguments","maxDepth","found","response","object","depth","camelCaseValue","charAt","toUpperCase","isArray","addTouchEvents","method","escape","string","badChars","shouldEscape","&","<",">","\"","'","`","escapedChar","chr","test","text","jQuery"],"mappings":";;;;;;;;;CAUC,SAAWA,EAAGC,EAAQC,EAAUC,GAEjC,YAEAF,GAA2B,mBAAVA,IAAyBA,EAAOG,MAAQA,KACrDH,EACgB,mBAARI,OAAuBA,KAAKD,MAAQA,KAC1CC,KACAC,SAAS,iBAGfN,EAAEO,GAAGC,MAAQ,SAASC,GACpB,GAgBEC,GAfAC,EAAiBX,EAAEY,MACnBC,EAAiBb,EAAEE,GACnBY,EAAiBd,EAAEC,GACnBc,EAAiBf,EAAE,QAEnBgB,EAAiBL,EAAYM,UAAY,GAEzCC,GAAiB,EACjBC,GAAiB,GAAIC,OAAOC,UAC5BC,KAEAC,EAAiBC,UAAU,GAC3BC,EAAkC,gBAATF,GACzBG,KAAoBC,MAAMC,KAAKJ,UAAW,EAgtC5C,OA5sCAb,GACGkB,KAAK,WACJ,GAsBEC,GACAC,EASAC,EACAC,EACAC,EACAC,EAlCAC,EAAoBpC,EAAEqC,cAAc5B,GAChCT,EAAEsC,QAAO,KAAUtC,EAAEO,GAAGC,MAAM4B,SAAU3B,GACxCT,EAAEsC,UAAWtC,EAAEO,GAAGC,MAAM4B,UAE5BnB,EAAqBmB,EAASnB,SAC9BsB,EAAqBH,EAASG,UAC9BC,EAAqBJ,EAASI,MAC9BC,EAAqBL,EAASK,SAC9BC,EAAqBN,EAASM,UAE9BC,EAAqB,IAAMP,EAASM,UACpCE,EAAqB,UAAYF,EAEjCG,EAAqB7C,EAAEY,MACvBkC,EAAqB9C,EAAEoC,EAASW,SAChCC,EAAqBhD,EAAEoC,EAASa,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,IAAK,SACLC,IAAK,SACLC,IAAK,UAEPC,EAAe,SAASC,GACtB,MAAOX,GAAOW,GAGlB,OAAGR,GAAaS,KAAKX,GACZA,EAAO3D,QAAQ4D,EAAUQ,GAE3BT,GAET/R,MAAO,SAAS2S,GACd,GACErL,GAAS,GACTwK,EAAStS,EAAEO,GAAGC,MAAM4B,SAAS6F,UAAUqK,MAYzC,cAVUa,KAAShT,UACPgT,GAAKpL,QAAU5H,GAAagT,EAAKpL,QACzCoL,EAAKpL,MAAQuK,EAAOa,EAAKpL,OACzBD,GAAQ,uBAAyBqL,EAAKpL,MAAQ,gBAEtCoL,GAAKnL,UAAY7H,GAAagT,EAAKnL,UAC3CmL,EAAKnL,QAAUsK,EAAOa,EAAKnL,SAC3BF,GAAQ,wBAA0BqL,EAAKnL,QAAU,WAG9CF,MAOTsL,OAAQnT,OAAQC","file":"popup.min.js","sourcesContent":["/*!\n * # Semantic UI 2.2.6 - Popup\n * http://github.com/semantic-org/semantic-ui/\n *\n *\n * Released under the MIT license\n * http://opensource.org/licenses/MIT\n *\n */\n\n;(function ($, window, document, undefined) {\n\n\"use strict\";\n\nwindow = (typeof window != 'undefined' && window.Math == Math)\n ? window\n : (typeof self != 'undefined' && self.Math == Math)\n ? self\n : Function('return this')()\n;\n\n$.fn.popup = function(parameters) {\n var\n $allModules = $(this),\n $document = $(document),\n $window = $(window),\n $body = $('body'),\n\n moduleSelector = $allModules.selector || '',\n\n hasTouch = (true),\n time = new Date().getTime(),\n performance = [],\n\n query = arguments[0],\n methodInvoked = (typeof query == 'string'),\n queryArguments = [].slice.call(arguments, 1),\n\n returnedValue\n ;\n $allModules\n .each(function() {\n var\n settings = ( $.isPlainObject(parameters) )\n ? $.extend(true, {}, $.fn.popup.settings, parameters)\n : $.extend({}, $.fn.popup.settings),\n\n selector = settings.selector,\n className = settings.className,\n error = settings.error,\n metadata = settings.metadata,\n namespace = settings.namespace,\n\n eventNamespace = '.' + settings.namespace,\n moduleNamespace = 'module-' + namespace,\n\n $module = $(this),\n $context = $(settings.context),\n $scrollContext = $(settings.scrollContext),\n $boundary = $(settings.boundary),\n $target = (settings.target)\n ? $(settings.target)\n : $module,\n\n $popup,\n $offsetParent,\n\n searchDepth = 0,\n triedPositions = false,\n openedWithTouch = false,\n\n element = this,\n instance = $module.data(moduleNamespace),\n\n documentObserver,\n elementNamespace,\n id,\n module\n ;\n\n module = {\n\n // binds events\n initialize: function() {\n module.debug('Initializing', $module);\n module.createID();\n module.bind.events();\n if(!module.exists() && settings.preserve) {\n module.create();\n }\n if(settings.observeChanges) {\n module.observeChanges();\n }\n module.instantiate();\n },\n\n instantiate: function() {\n module.verbose('Storing instance', module);\n instance = module;\n $module\n .data(moduleNamespace, instance)\n ;\n },\n\n observeChanges: function() {\n if('MutationObserver' in window) {\n documentObserver = new MutationObserver(module.event.documentChanged);\n documentObserver.observe(document, {\n childList : true,\n subtree : true\n });\n module.debug('Setting up mutation observer', documentObserver);\n }\n },\n\n refresh: function() {\n if(settings.popup) {\n $popup = $(settings.popup).eq(0);\n }\n else {\n if(settings.inline) {\n $popup = $target.nextAll(selector.popup).eq(0);\n settings.popup = $popup;\n }\n }\n if(settings.popup) {\n $popup.addClass(className.loading);\n $offsetParent = module.get.offsetParent();\n $popup.removeClass(className.loading);\n if(settings.movePopup && module.has.popup() && module.get.offsetParent($popup)[0] !== $offsetParent[0]) {\n module.debug('Moving popup to the same offset parent as activating element');\n $popup\n .detach()\n .appendTo($offsetParent)\n ;\n }\n }\n else {\n $offsetParent = (settings.inline)\n ? module.get.offsetParent($target)\n : module.has.popup()\n ? module.get.offsetParent($popup)\n : $body\n ;\n }\n if( $offsetParent.is('html') && $offsetParent[0] !== $body[0] ) {\n module.debug('Setting page as offset parent');\n $offsetParent = $body;\n }\n if( module.get.variation() ) {\n module.set.variation();\n }\n },\n\n reposition: function() {\n module.refresh();\n module.set.position();\n },\n\n destroy: function() {\n module.debug('Destroying previous module');\n if(documentObserver) {\n documentObserver.disconnect();\n }\n // remove element only if was created dynamically\n if($popup && !settings.preserve) {\n module.removePopup();\n }\n // clear all timeouts\n clearTimeout(module.hideTimer);\n clearTimeout(module.showTimer);\n // remove events\n module.unbind.close();\n module.unbind.events();\n $module\n .removeData(moduleNamespace)\n ;\n },\n\n event: {\n start: function(event) {\n var\n delay = ($.isPlainObject(settings.delay))\n ? settings.delay.show\n : settings.delay\n ;\n clearTimeout(module.hideTimer);\n if(!openedWithTouch) {\n module.showTimer = setTimeout(module.show, delay);\n }\n },\n end: function() {\n var\n delay = ($.isPlainObject(settings.delay))\n ? settings.delay.hide\n : settings.delay\n ;\n clearTimeout(module.showTimer);\n module.hideTimer = setTimeout(module.hide, delay);\n },\n touchstart: function(event) {\n openedWithTouch = true;\n module.show();\n },\n resize: function() {\n if( module.is.visible() ) {\n module.set.position();\n }\n },\n documentChanged: function(mutations) {\n [].forEach.call(mutations, function(mutation) {\n if(mutation.removedNodes) {\n [].forEach.call(mutation.removedNodes, function(node) {\n if(node == element || $(node).find(element).length > 0) {\n module.debug('Element removed from DOM, tearing down events');\n module.destroy();\n }\n });\n }\n });\n },\n hideGracefully: function(event) {\n var\n $target = $(event.target),\n isInDOM = $.contains(document.documentElement, event.target),\n inPopup = ($target.closest(selector.popup).length > 0)\n ;\n // don't close on clicks inside popup\n if(event && !inPopup && isInDOM) {\n module.debug('Click occurred outside popup hiding popup');\n module.hide();\n }\n else {\n module.debug('Click was inside popup, keeping popup open');\n }\n }\n },\n\n // generates popup html from metadata\n create: function() {\n var\n html = module.get.html(),\n title = module.get.title(),\n content = module.get.content()\n ;\n\n if(html || content || title) {\n module.debug('Creating pop-up html');\n if(!html) {\n html = settings.templates.popup({\n title : title,\n content : content\n });\n }\n $popup = $('
')\n .addClass(className.popup)\n .data(metadata.activator, $module)\n .html(html)\n ;\n if(settings.inline) {\n module.verbose('Inserting popup element inline', $popup);\n $popup\n .insertAfter($module)\n ;\n }\n else {\n module.verbose('Appending popup element to body', $popup);\n $popup\n .appendTo( $context )\n ;\n }\n module.refresh();\n module.set.variation();\n\n if(settings.hoverable) {\n module.bind.popup();\n }\n settings.onCreate.call($popup, element);\n }\n else if($target.next(selector.popup).length !== 0) {\n module.verbose('Pre-existing popup found');\n settings.inline = true;\n settings.popup = $target.next(selector.popup).data(metadata.activator, $module);\n module.refresh();\n if(settings.hoverable) {\n module.bind.popup();\n }\n }\n else if(settings.popup) {\n $(settings.popup).data(metadata.activator, $module);\n module.verbose('Used popup specified in settings');\n module.refresh();\n if(settings.hoverable) {\n module.bind.popup();\n }\n }\n else {\n module.debug('No content specified skipping display', element);\n }\n },\n\n createID: function() {\n id = (Math.random().toString(16) + '000000000').substr(2, 8);\n elementNamespace = '.' + id;\n module.verbose('Creating unique id for element', id);\n },\n\n // determines popup state\n toggle: function() {\n module.debug('Toggling pop-up');\n if( module.is.hidden() ) {\n module.debug('Popup is hidden, showing pop-up');\n module.unbind.close();\n module.show();\n }\n else {\n module.debug('Popup is visible, hiding pop-up');\n module.hide();\n }\n },\n\n show: function(callback) {\n callback = callback || function(){};\n module.debug('Showing pop-up', settings.transition);\n if(module.is.hidden() && !( module.is.active() && module.is.dropdown()) ) {\n if( !module.exists() ) {\n module.create();\n }\n if(settings.onShow.call($popup, element) === false) {\n module.debug('onShow callback returned false, cancelling popup animation');\n return;\n }\n else if(!settings.preserve && !settings.popup) {\n module.refresh();\n }\n if( $popup && module.set.position() ) {\n module.save.conditions();\n if(settings.exclusive) {\n module.hideAll();\n }\n module.animate.show(callback);\n }\n }\n },\n\n\n hide: function(callback) {\n callback = callback || function(){};\n if( module.is.visible() || module.is.animating() ) {\n if(settings.onHide.call($popup, element) === false) {\n module.debug('onHide callback returned false, cancelling popup animation');\n return;\n }\n module.remove.visible();\n module.unbind.close();\n module.restore.conditions();\n module.animate.hide(callback);\n }\n },\n\n hideAll: function() {\n $(selector.popup)\n .filter('.' + className.visible)\n .each(function() {\n $(this)\n .data(metadata.activator)\n .popup('hide')\n ;\n })\n ;\n },\n exists: function() {\n if(!$popup) {\n return false;\n }\n if(settings.inline || settings.popup) {\n return ( module.has.popup() );\n }\n else {\n return ( $popup.closest($context).length >= 1 )\n ? true\n : false\n ;\n }\n },\n\n removePopup: function() {\n if( module.has.popup() && !settings.popup) {\n module.debug('Removing popup', $popup);\n $popup.remove();\n $popup = undefined;\n settings.onRemove.call($popup, element);\n }\n },\n\n save: {\n conditions: function() {\n module.cache = {\n title: $module.attr('title')\n };\n if (module.cache.title) {\n $module.removeAttr('title');\n }\n module.verbose('Saving original attributes', module.cache.title);\n }\n },\n restore: {\n conditions: function() {\n if(module.cache && module.cache.title) {\n $module.attr('title', module.cache.title);\n module.verbose('Restoring original attributes', module.cache.title);\n }\n return true;\n }\n },\n supports: {\n svg: function() {\n return (typeof SVGGraphicsElement === undefined);\n }\n },\n animate: {\n show: function(callback) {\n callback = $.isFunction(callback) ? callback : function(){};\n if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {\n module.set.visible();\n $popup\n .transition({\n animation : settings.transition + ' in',\n queue : false,\n debug : settings.debug,\n verbose : settings.verbose,\n duration : settings.duration,\n onComplete : function() {\n module.bind.close();\n callback.call($popup, element);\n settings.onVisible.call($popup, element);\n }\n })\n ;\n }\n else {\n module.error(error.noTransition);\n }\n },\n hide: function(callback) {\n callback = $.isFunction(callback) ? callback : function(){};\n module.debug('Hiding pop-up');\n if(settings.onHide.call($popup, element) === false) {\n module.debug('onHide callback returned false, cancelling popup animation');\n return;\n }\n if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {\n $popup\n .transition({\n animation : settings.transition + ' out',\n queue : false,\n duration : settings.duration,\n debug : settings.debug,\n verbose : settings.verbose,\n onComplete : function() {\n module.reset();\n callback.call($popup, element);\n settings.onHidden.call($popup, element);\n }\n })\n ;\n }\n else {\n module.error(error.noTransition);\n }\n }\n },\n\n change: {\n content: function(html) {\n $popup.html(html);\n }\n },\n\n get: {\n html: function() {\n $module.removeData(metadata.html);\n return $module.data(metadata.html) || settings.html;\n },\n title: function() {\n $module.removeData(metadata.title);\n return $module.data(metadata.title) || settings.title;\n },\n content: function() {\n $module.removeData(metadata.content);\n return $module.data(metadata.content) || $module.attr('title') || settings.content;\n },\n variation: function() {\n $module.removeData(metadata.variation);\n return $module.data(metadata.variation) || settings.variation;\n },\n popup: function() {\n return $popup;\n },\n popupOffset: function() {\n return $popup.offset();\n },\n calculations: function() {\n var\n targetElement = $target[0],\n isWindow = ($boundary[0] == window),\n targetPosition = (settings.inline || (settings.popup && settings.movePopup))\n ? $target.position()\n : $target.offset(),\n screenPosition = (isWindow)\n ? { top: 0, left: 0 }\n : $boundary.offset(),\n calculations = {},\n scroll = (isWindow)\n ? { top: $window.scrollTop(), left: $window.scrollLeft() }\n : { top: 0, left: 0},\n screen\n ;\n calculations = {\n // element which is launching popup\n target : {\n element : $target[0],\n width : $target.outerWidth(),\n height : $target.outerHeight(),\n top : targetPosition.top,\n left : targetPosition.left,\n margin : {}\n },\n // popup itself\n popup : {\n width : $popup.outerWidth(),\n height : $popup.outerHeight()\n },\n // offset container (or 3d context)\n parent : {\n width : $offsetParent.outerWidth(),\n height : $offsetParent.outerHeight()\n },\n // screen boundaries\n screen : {\n top : screenPosition.top,\n left : screenPosition.left,\n scroll: {\n top : scroll.top,\n left : scroll.left\n },\n width : $boundary.width(),\n height : $boundary.height()\n }\n };\n\n // add in container calcs if fluid\n if( settings.setFluidWidth && module.is.fluid() ) {\n calculations.container = {\n width: $popup.parent().outerWidth()\n };\n calculations.popup.width = calculations.container.width;\n }\n\n // add in margins if inline\n calculations.target.margin.top = (settings.inline)\n ? parseInt( window.getComputedStyle(targetElement).getPropertyValue('margin-top'), 10)\n : 0\n ;\n calculations.target.margin.left = (settings.inline)\n ? module.is.rtl()\n ? parseInt( window.getComputedStyle(targetElement).getPropertyValue('margin-right'), 10)\n : parseInt( window.getComputedStyle(targetElement).getPropertyValue('margin-left'), 10)\n : 0\n ;\n // calculate screen boundaries\n screen = calculations.screen;\n calculations.boundary = {\n top : screen.top + screen.scroll.top,\n bottom : screen.top + screen.scroll.top + screen.height,\n left : screen.left + screen.scroll.left,\n right : screen.left + screen.scroll.left + screen.width\n };\n return calculations;\n },\n id: function() {\n return id;\n },\n startEvent: function() {\n if(settings.on == 'hover') {\n return 'mouseenter';\n }\n else if(settings.on == 'focus') {\n return 'focus';\n }\n return false;\n },\n scrollEvent: function() {\n return 'scroll';\n },\n endEvent: function() {\n if(settings.on == 'hover') {\n return 'mouseleave';\n }\n else if(settings.on == 'focus') {\n return 'blur';\n }\n return false;\n },\n distanceFromBoundary: function(offset, calculations) {\n var\n distanceFromBoundary = {},\n popup,\n boundary\n ;\n calculations = calculations || module.get.calculations();\n\n // shorthand\n popup = calculations.popup;\n boundary = calculations.boundary;\n\n if(offset) {\n distanceFromBoundary = {\n top : (offset.top - boundary.top),\n left : (offset.left - boundary.left),\n right : (boundary.right - (offset.left + popup.width) ),\n bottom : (boundary.bottom - (offset.top + popup.height) )\n };\n module.verbose('Distance from boundaries determined', offset, distanceFromBoundary);\n }\n return distanceFromBoundary;\n },\n offsetParent: function($target) {\n var\n element = ($target !== undefined)\n ? $target[0]\n : $module[0],\n parentNode = element.parentNode,\n $node = $(parentNode)\n ;\n if(parentNode) {\n var\n is2D = ($node.css('transform') === 'none'),\n isStatic = ($node.css('position') === 'static'),\n isHTML = $node.is('html')\n ;\n while(parentNode && !isHTML && isStatic && is2D) {\n parentNode = parentNode.parentNode;\n $node = $(parentNode);\n is2D = ($node.css('transform') === 'none');\n isStatic = ($node.css('position') === 'static');\n isHTML = $node.is('html');\n }\n }\n return ($node && $node.length > 0)\n ? $node\n : $()\n ;\n },\n positions: function() {\n return {\n 'top left' : false,\n 'top center' : false,\n 'top right' : false,\n 'bottom left' : false,\n 'bottom center' : false,\n 'bottom right' : false,\n 'left center' : false,\n 'right center' : false\n };\n },\n nextPosition: function(position) {\n var\n positions = position.split(' '),\n verticalPosition = positions[0],\n horizontalPosition = positions[1],\n opposite = {\n top : 'bottom',\n bottom : 'top',\n left : 'right',\n right : 'left'\n },\n adjacent = {\n left : 'center',\n center : 'right',\n right : 'left'\n },\n backup = {\n 'top left' : 'top center',\n 'top center' : 'top right',\n 'top right' : 'right center',\n 'right center' : 'bottom right',\n 'bottom right' : 'bottom center',\n 'bottom center' : 'bottom left',\n 'bottom left' : 'left center',\n 'left center' : 'top left'\n },\n adjacentsAvailable = (verticalPosition == 'top' || verticalPosition == 'bottom'),\n oppositeTried = false,\n adjacentTried = false,\n nextPosition = false\n ;\n if(!triedPositions) {\n module.verbose('All available positions available');\n triedPositions = module.get.positions();\n }\n\n module.debug('Recording last position tried', position);\n triedPositions[position] = true;\n\n if(settings.prefer === 'opposite') {\n nextPosition = [opposite[verticalPosition], horizontalPosition];\n nextPosition = nextPosition.join(' ');\n oppositeTried = (triedPositions[nextPosition] === true);\n module.debug('Trying opposite strategy', nextPosition);\n }\n if((settings.prefer === 'adjacent') && adjacentsAvailable ) {\n nextPosition = [verticalPosition, adjacent[horizontalPosition]];\n nextPosition = nextPosition.join(' ');\n adjacentTried = (triedPositions[nextPosition] === true);\n module.debug('Trying adjacent strategy', nextPosition);\n }\n if(adjacentTried || oppositeTried) {\n module.debug('Using backup position', nextPosition);\n nextPosition = backup[position];\n }\n return nextPosition;\n }\n },\n\n set: {\n position: function(position, calculations) {\n\n // exit conditions\n if($target.length === 0 || $popup.length === 0) {\n module.error(error.notFound);\n return;\n }\n var\n offset,\n distanceAway,\n target,\n popup,\n parent,\n positioning,\n popupOffset,\n distanceFromBoundary\n ;\n\n calculations = calculations || module.get.calculations();\n position = position || $module.data(metadata.position) || settings.position;\n\n offset = $module.data(metadata.offset) || settings.offset;\n distanceAway = settings.distanceAway;\n\n // shorthand\n target = calculations.target;\n popup = calculations.popup;\n parent = calculations.parent;\n\n if(target.width === 0 && target.height === 0 && !module.is.svg(target.element)) {\n module.debug('Popup target is hidden, no action taken');\n return false;\n }\n\n if(settings.inline) {\n module.debug('Adding margin to calculation', target.margin);\n if(position == 'left center' || position == 'right center') {\n offset += target.margin.top;\n distanceAway += -target.margin.left;\n }\n else if (position == 'top left' || position == 'top center' || position == 'top right') {\n offset += target.margin.left;\n distanceAway -= target.margin.top;\n }\n else {\n offset += target.margin.left;\n distanceAway += target.margin.top;\n }\n }\n\n module.debug('Determining popup position from calculations', position, calculations);\n\n if (module.is.rtl()) {\n position = position.replace(/left|right/g, function (match) {\n return (match == 'left')\n ? 'right'\n : 'left'\n ;\n });\n module.debug('RTL: Popup position updated', position);\n }\n\n // if last attempt use specified last resort position\n if(searchDepth == settings.maxSearchDepth && typeof settings.lastResort === 'string') {\n position = settings.lastResort;\n }\n\n switch (position) {\n case 'top left':\n positioning = {\n top : 'auto',\n bottom : parent.height - target.top + distanceAway,\n left : target.left + offset,\n right : 'auto'\n };\n break;\n case 'top center':\n positioning = {\n bottom : parent.height - target.top + distanceAway,\n left : target.left + (target.width / 2) - (popup.width / 2) + offset,\n top : 'auto',\n right : 'auto'\n };\n break;\n case 'top right':\n positioning = {\n bottom : parent.height - target.top + distanceAway,\n right : parent.width - target.left - target.width - offset,\n top : 'auto',\n left : 'auto'\n };\n break;\n case 'left center':\n positioning = {\n top : target.top + (target.height / 2) - (popup.height / 2) + offset,\n right : parent.width - target.left + distanceAway,\n left : 'auto',\n bottom : 'auto'\n };\n break;\n case 'right center':\n positioning = {\n top : target.top + (target.height / 2) - (popup.height / 2) + offset,\n left : target.left + target.width + distanceAway,\n bottom : 'auto',\n right : 'auto'\n };\n break;\n case 'bottom left':\n positioning = {\n top : target.top + target.height + distanceAway,\n left : target.left + offset,\n bottom : 'auto',\n right : 'auto'\n };\n break;\n case 'bottom center':\n positioning = {\n top : target.top + target.height + distanceAway,\n left : target.left + (target.width / 2) - (popup.width / 2) + offset,\n bottom : 'auto',\n right : 'auto'\n };\n break;\n case 'bottom right':\n positioning = {\n top : target.top + target.height + distanceAway,\n right : parent.width - target.left - target.width - offset,\n left : 'auto',\n bottom : 'auto'\n };\n break;\n }\n if(positioning === undefined) {\n module.error(error.invalidPosition, position);\n }\n\n module.debug('Calculated popup positioning values', positioning);\n\n // tentatively place on stage\n $popup\n .css(positioning)\n .removeClass(className.position)\n .addClass(position)\n .addClass(className.loading)\n ;\n\n popupOffset = module.get.popupOffset();\n\n // see if any boundaries are surpassed with this tentative position\n distanceFromBoundary = module.get.distanceFromBoundary(popupOffset, calculations);\n\n if( module.is.offstage(distanceFromBoundary, position) ) {\n module.debug('Position is outside viewport', position);\n if(searchDepth < settings.maxSearchDepth) {\n searchDepth++;\n position = module.get.nextPosition(position);\n module.debug('Trying new position', position);\n return ($popup)\n ? module.set.position(position, calculations)\n : false\n ;\n }\n else {\n if(settings.lastResort) {\n module.debug('No position found, showing with last position');\n }\n else {\n module.debug('Popup could not find a position to display', $popup);\n module.error(error.cannotPlace, element);\n module.remove.attempts();\n module.remove.loading();\n module.reset();\n settings.onUnplaceable.call($popup, element);\n return false;\n }\n }\n }\n module.debug('Position is on stage', position);\n module.remove.attempts();\n module.remove.loading();\n if( settings.setFluidWidth && module.is.fluid() ) {\n module.set.fluidWidth(calculations);\n }\n return true;\n },\n\n fluidWidth: function(calculations) {\n calculations = calculations || module.get.calculations();\n module.debug('Automatically setting element width to parent width', calculations.parent.width);\n $popup.css('width', calculations.container.width);\n },\n\n variation: function(variation) {\n variation = variation || module.get.variation();\n if(variation && module.has.popup() ) {\n module.verbose('Adding variation to popup', variation);\n $popup.addClass(variation);\n }\n },\n\n visible: function() {\n $module.addClass(className.visible);\n }\n },\n\n remove: {\n loading: function() {\n $popup.removeClass(className.loading);\n },\n variation: function(variation) {\n variation = variation || module.get.variation();\n if(variation) {\n module.verbose('Removing variation', variation);\n $popup.removeClass(variation);\n }\n },\n visible: function() {\n $module.removeClass(className.visible);\n },\n attempts: function() {\n module.verbose('Resetting all searched positions');\n searchDepth = 0;\n triedPositions = false;\n }\n },\n\n bind: {\n events: function() {\n module.debug('Binding popup events to module');\n if(settings.on == 'click') {\n $module\n .on('click' + eventNamespace, module.toggle)\n ;\n }\n if(settings.on == 'hover' && hasTouch) {\n $module\n .on('touchstart' + eventNamespace, module.event.touchstart)\n ;\n }\n if( module.get.startEvent() ) {\n $module\n .on(module.get.startEvent() + eventNamespace, module.event.start)\n .on(module.get.endEvent() + eventNamespace, module.event.end)\n ;\n }\n if(settings.target) {\n module.debug('Target set to element', $target);\n }\n $window.on('resize' + elementNamespace, module.event.resize);\n },\n popup: function() {\n module.verbose('Allowing hover events on popup to prevent closing');\n if( $popup && module.has.popup() ) {\n $popup\n .on('mouseenter' + eventNamespace, module.event.start)\n .on('mouseleave' + eventNamespace, module.event.end)\n ;\n }\n },\n close: function() {\n if(settings.hideOnScroll === true || (settings.hideOnScroll == 'auto' && settings.on != 'click')) {\n $scrollContext\n .one(module.get.scrollEvent() + elementNamespace, module.event.hideGracefully)\n ;\n }\n if(settings.on == 'hover' && openedWithTouch) {\n module.verbose('Binding popup close event to document');\n $document\n .on('touchstart' + elementNamespace, function(event) {\n module.verbose('Touched away from popup');\n module.event.hideGracefully.call(element, event);\n })\n ;\n }\n if(settings.on == 'click' && settings.closable) {\n module.verbose('Binding popup close event to document');\n $document\n .on('click' + elementNamespace, function(event) {\n module.verbose('Clicked away from popup');\n module.event.hideGracefully.call(element, event);\n })\n ;\n }\n }\n },\n\n unbind: {\n events: function() {\n $window\n .off(elementNamespace)\n ;\n $module\n .off(eventNamespace)\n ;\n },\n close: function() {\n $document\n .off(elementNamespace)\n ;\n $scrollContext\n .off(elementNamespace)\n ;\n },\n },\n\n has: {\n popup: function() {\n return ($popup && $popup.length > 0);\n }\n },\n\n is: {\n offstage: function(distanceFromBoundary, position) {\n var\n offstage = []\n ;\n // return boundaries that have been surpassed\n $.each(distanceFromBoundary, function(direction, distance) {\n if(distance < -settings.jitter) {\n module.debug('Position exceeds allowable distance from edge', direction, distance, position);\n offstage.push(direction);\n }\n });\n if(offstage.length > 0) {\n return true;\n }\n else {\n return false;\n }\n },\n svg: function(element) {\n return module.supports.svg() && (element instanceof SVGGraphicsElement);\n },\n active: function() {\n return $module.hasClass(className.active);\n },\n animating: function() {\n return ($popup !== undefined && $popup.hasClass(className.animating) );\n },\n fluid: function() {\n return ($popup !== undefined && $popup.hasClass(className.fluid));\n },\n visible: function() {\n return ($popup !== undefined && $popup.hasClass(className.visible));\n },\n dropdown: function() {\n return $module.hasClass(className.dropdown);\n },\n hidden: function() {\n return !module.is.visible();\n },\n rtl: function () {\n return $module.css('direction') == 'rtl';\n }\n },\n\n reset: function() {\n module.remove.visible();\n if(settings.preserve) {\n if($.fn.transition !== undefined) {\n $popup\n .transition('remove transition')\n ;\n }\n }\n else {\n module.removePopup();\n }\n },\n\n setting: function(name, value) {\n if( $.isPlainObject(name) ) {\n $.extend(true, settings, name);\n }\n else if(value !== undefined) {\n settings[name] = value;\n }\n else {\n return settings[name];\n }\n },\n internal: function(name, value) {\n if( $.isPlainObject(name) ) {\n $.extend(true, module, name);\n }\n else if(value !== undefined) {\n module[name] = value;\n }\n else {\n return module[name];\n }\n },\n debug: function() {\n if(!settings.silent && settings.debug) {\n if(settings.performance) {\n module.performance.log(arguments);\n }\n else {\n module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');\n module.debug.apply(console, arguments);\n }\n }\n },\n verbose: function() {\n if(!settings.silent && settings.verbose && settings.debug) {\n if(settings.performance) {\n module.performance.log(arguments);\n }\n else {\n module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');\n module.verbose.apply(console, arguments);\n }\n }\n },\n error: function() {\n if(!settings.silent) {\n module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');\n module.error.apply(console, arguments);\n }\n },\n performance: {\n log: function(message) {\n var\n currentTime,\n executionTime,\n previousTime\n ;\n if(settings.performance) {\n currentTime = new Date().getTime();\n previousTime = time || currentTime;\n executionTime = currentTime - previousTime;\n time = currentTime;\n performance.push({\n 'Name' : message[0],\n 'Arguments' : [].slice.call(message, 1) || '',\n 'Element' : element,\n 'Execution Time' : executionTime\n });\n }\n clearTimeout(module.performance.timer);\n module.performance.timer = setTimeout(module.performance.display, 500);\n },\n display: function() {\n var\n title = settings.name + ':',\n totalTime = 0\n ;\n time = false;\n clearTimeout(module.performance.timer);\n $.each(performance, function(index, data) {\n totalTime += data['Execution Time'];\n });\n title += ' ' + totalTime + 'ms';\n if(moduleSelector) {\n title += ' \\'' + moduleSelector + '\\'';\n }\n if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {\n console.groupCollapsed(title);\n if(console.table) {\n console.table(performance);\n }\n else {\n $.each(performance, function(index, data) {\n console.log(data['Name'] + ': ' + data['Execution Time']+'ms');\n });\n }\n console.groupEnd();\n }\n performance = [];\n }\n },\n invoke: function(query, passedArguments, context) {\n var\n object = instance,\n maxDepth,\n found,\n response\n ;\n passedArguments = passedArguments || queryArguments;\n context = element || context;\n if(typeof query == 'string' && object !== undefined) {\n query = query.split(/[\\. ]/);\n maxDepth = query.length - 1;\n $.each(query, function(depth, value) {\n var camelCaseValue = (depth != maxDepth)\n ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)\n : query\n ;\n if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {\n object = object[camelCaseValue];\n }\n else if( object[camelCaseValue] !== undefined ) {\n found = object[camelCaseValue];\n return false;\n }\n else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {\n object = object[value];\n }\n else if( object[value] !== undefined ) {\n found = object[value];\n return false;\n }\n else {\n return false;\n }\n });\n }\n if ( $.isFunction( found ) ) {\n response = found.apply(context, passedArguments);\n }\n else if(found !== undefined) {\n response = found;\n }\n if($.isArray(returnedValue)) {\n returnedValue.push(response);\n }\n else if(returnedValue !== undefined) {\n returnedValue = [returnedValue, response];\n }\n else if(response !== undefined) {\n returnedValue = response;\n }\n return found;\n }\n };\n\n if(methodInvoked) {\n if(instance === undefined) {\n module.initialize();\n }\n module.invoke(query);\n }\n else {\n if(instance !== undefined) {\n instance.invoke('destroy');\n }\n module.initialize();\n }\n })\n ;\n\n return (returnedValue !== undefined)\n ? returnedValue\n : this\n ;\n};\n\n$.fn.popup.settings = {\n\n name : 'Popup',\n\n // module settings\n silent : false,\n debug : false,\n verbose : false,\n performance : true,\n namespace : 'popup',\n\n // whether it should use dom mutation observers\n observeChanges : true,\n\n // callback only when element added to dom\n onCreate : function(){},\n\n // callback before element removed from dom\n onRemove : function(){},\n\n // callback before show animation\n onShow : function(){},\n\n // callback after show animation\n onVisible : function(){},\n\n // callback before hide animation\n onHide : function(){},\n\n // callback when popup cannot be positioned in visible screen\n onUnplaceable : function(){},\n\n // callback after hide animation\n onHidden : function(){},\n\n // when to show popup\n on : 'hover',\n\n // element to use to determine if popup is out of boundary\n boundary : window,\n\n // whether to add touchstart events when using hover\n addTouchEvents : true,\n\n // default position relative to element\n position : 'top left',\n\n // name of variation to use\n variation : '',\n\n // whether popup should be moved to context\n movePopup : true,\n\n // element which popup should be relative to\n target : false,\n\n // jq selector or element that should be used as popup\n popup : false,\n\n // popup should remain inline next to activator\n inline : false,\n\n // popup should be removed from page on hide\n preserve : false,\n\n // popup should not close when being hovered on\n hoverable : false,\n\n // explicitly set content\n content : false,\n\n // explicitly set html\n html : false,\n\n // explicitly set title\n title : false,\n\n // whether automatically close on clickaway when on click\n closable : true,\n\n // automatically hide on scroll\n hideOnScroll : 'auto',\n\n // hide other popups on show\n exclusive : false,\n\n // context to attach popups\n context : 'body',\n\n // context for binding scroll events\n scrollContext : window,\n\n // position to prefer when calculating new position\n prefer : 'opposite',\n\n // specify position to appear even if it doesn't fit\n lastResort : false,\n\n // delay used to prevent accidental refiring of animations due to user error\n delay : {\n show : 50,\n hide : 70\n },\n\n // whether fluid variation should assign width explicitly\n setFluidWidth : true,\n\n // transition settings\n duration : 200,\n transition : 'scale',\n\n // distance away from activating element in px\n distanceAway : 0,\n\n // number of pixels an element is allowed to be \"offstage\" for a position to be chosen (allows for rounding)\n jitter : 2,\n\n // offset on aligning axis from calculated position\n offset : 0,\n\n // maximum times to look for a position before failing (9 positions total)\n maxSearchDepth : 15,\n\n error: {\n invalidPosition : 'The position you specified is not a valid position',\n cannotPlace : 'Popup does not fit within the boundaries of the viewport',\n method : 'The method you called is not defined.',\n noTransition : 'This module requires ui transitions ',\n notFound : 'The target or popup you specified does not exist on the page'\n },\n\n metadata: {\n activator : 'activator',\n content : 'content',\n html : 'html',\n offset : 'offset',\n position : 'position',\n title : 'title',\n variation : 'variation'\n },\n\n className : {\n active : 'active',\n animating : 'animating',\n dropdown : 'dropdown',\n fluid : 'fluid',\n loading : 'loading',\n popup : 'ui popup',\n position : 'top left center bottom right',\n visible : 'visible'\n },\n\n selector : {\n popup : '.ui.popup'\n },\n\n templates: {\n escape: function(string) {\n var\n badChars = /[&<>\"'`]/g,\n shouldEscape = /[&<>\"'`]/,\n escape = {\n \"&\": \"&\",\n \"<\": \"<\",\n \">\": \">\",\n '\"': \""\",\n \"'\": \"'\",\n \"`\": \"`\"\n },\n escapedChar = function(chr) {\n return escape[chr];\n }\n ;\n if(shouldEscape.test(string)) {\n return string.replace(badChars, escapedChar);\n }\n return string;\n },\n popup: function(text) {\n var\n html = '',\n escape = $.fn.popup.settings.templates.escape\n ;\n if(typeof text !== undefined) {\n if(typeof text.title !== undefined && text.title) {\n text.title = escape(text.title);\n html += '
' + text.title + '
';\n }\n if(typeof text.content !== undefined && text.content) {\n text.content = escape(text.content);\n html += '
' + text.content + '
';\n }\n }\n return html;\n }\n }\n\n};\n\n\n})( jQuery, window, document );\n"]}