diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 2084199..937cf5d 100755 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,3 +1,10 @@ +### Version 1.11.0 - March 3, 2015 + +- **Popup** - Added `exclusive` parameter to automatically close other popups on open +- **Popup** - Fix issue with `popup` not re-opening until another element gains focus on a mobile touchscreen +- **Popup** - Popup will now fire `onHidden` when an element is hidden by opening a different popup +- **Popup** - Fix popup not namespacing `window` events and unbinding on `destroy` **Thanks @revov** + ### UI Changes - **Transition** - Transitions with direction now use word order dependency to prevent conflict with component directions, for example `bottom left popup slide down in transition diff --git a/composer.json b/composer.json index 5b25133..daeead5 100755 --- a/composer.json +++ b/composer.json @@ -15,5 +15,5 @@ "framework" ], "license": "MIT", - "version": "1.10.3" + "version": "1.11.0" } \ No newline at end of file diff --git a/index.js b/index.js index ef9cd52..8f71a71 100755 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ /*! - * # Semantic UI 1.10.3 - Popup + * # Semantic UI 1.11.0 - Popup * http://github.com/semantic-org/semantic-ui/ * * @@ -64,6 +64,9 @@ module.exports = function(parameters) { element = this, instance = $module.data(moduleNamespace), + + elementNamespace, + id, module ; @@ -71,24 +74,9 @@ module.exports = function(parameters) { // binds events initialize: function() { - module.debug('Initializing module', $module); - if(settings.on == 'click') { - $module - .on('click' + eventNamespace, module.toggle) - ; - } - else if( module.get.startEvent() ) { - $module - .on(module.get.startEvent() + eventNamespace, module.event.start) - .on(module.get.endEvent() + eventNamespace, module.event.end) - ; - } - if(settings.target) { - module.debug('Target set to element', $target); - } - $window - .on('resize' + eventNamespace, module.event.resize) - ; + module.debug('Initializing', $module); + module.createID(); + module.bind.events(); if( !module.exists() && settings.preserve) { module.create(); } @@ -96,7 +84,7 @@ module.exports = function(parameters) { }, instantiate: function() { - module.verbose('Storing instance of module', module); + module.verbose('Storing instance', module); instance = module; $module .data(moduleNamespace, instance) @@ -145,11 +133,15 @@ module.exports = function(parameters) { destroy: function() { module.debug('Destroying previous module'); + // remove element only if was created dynamically if($popup && !settings.preserve) { module.removePopup(); } + // clear all timeouts clearTimeout(module.hideTimer); clearTimeout(module.showTimer); + // remove events + $window.off(elementNamespace); $module .off(eventNamespace) .removeData(moduleNamespace) @@ -209,6 +201,7 @@ module.exports = function(parameters) { $popup = $('
') .addClass(className.popup) .addClass(variation) + .data(metadata.activator, $module) .html(html) ; if(variation) { @@ -237,13 +230,14 @@ module.exports = function(parameters) { else if($target.next(selector.popup).length !== 0) { module.verbose('Pre-existing popup found'); settings.inline = true; - settings.popup = $target.next(selector.popup); + settings.popup = $target.next(selector.popup).data(metadata.activator, $module); module.refresh(); if(settings.hoverable) { module.bind.popup(); } } else if(settings.popup) { + settings.popup.data(metadata.activator, $module); module.verbose('Used popup specified in settings'); module.refresh(); if(settings.hoverable) { @@ -255,13 +249,18 @@ module.exports = function(parameters) { } }, + createID: function() { + id = (Math.random().toString(16) + '000000000').substr(2,8); + elementNamespace = '.' + id; + module.verbose('Creating unique id for element', id); + }, + // determines popup state toggle: function() { module.debug('Toggling pop-up'); if( module.is.hidden() ) { module.debug('Popup is hidden, showing pop-up'); module.unbind.close(); - module.hideAll(); module.show(); } else { @@ -281,6 +280,9 @@ module.exports = function(parameters) { } if( $popup && module.set.position() ) { module.save.conditions(); + if(settings.exclusive) { + module.hideAll(); + } module.animate.show(callback); } }, @@ -298,8 +300,13 @@ module.exports = function(parameters) { hideAll: function() { $(selector.popup) - .filter(':visible') - .transition(settings.transition) + .filter('.' + className.visible) + .each(function() { + $(this) + .data(metadata.activator) + .popup('hide') + ; + }) ; }, @@ -425,15 +432,27 @@ module.exports = function(parameters) { }, get: { + id: function() { + return id; + }, startEvent: function() { if(settings.on == 'hover') { - return 'mouseenter'; + return (hasTouch) + ? 'touchstart mouseenter' + : 'mouseenter' + ; } else if(settings.on == 'focus') { return 'focus'; } return false; }, + scrollEvent: function() { + return (hasTouch) + ? 'touchmove scroll' + : 'scroll' + ; + }, endEvent: function() { if(settings.on == 'hover') { return 'mouseleave'; @@ -743,7 +762,7 @@ module.exports = function(parameters) { } else if(!settings.lastResort) { module.debug('Popup could not find a position in view', $popup); - module.error(error.cannotPlace); + module.error(error.cannotPlace, element); module.remove.attempts(); module.remove.loading(); module.reset(); @@ -784,6 +803,24 @@ module.exports = function(parameters) { }, bind: { + events: function() { + module.debug('Binding popup events to module'); + if(settings.on == 'click') { + $module + .on('click' + eventNamespace, module.toggle) + ; + } + else if( module.get.startEvent() ) { + $module + .on(module.get.startEvent() + eventNamespace, module.event.start) + .on(module.get.endEvent() + eventNamespace, module.event.end) + ; + } + if(settings.target) { + module.debug('Target set to element', $target); + } + $window.on('resize' + elementNamespace, module.event.resize); + }, popup: function() { module.verbose('Allowing hover events on popup to prevent closing'); if( $popup && module.has.popup() ) { @@ -796,18 +833,16 @@ module.exports = function(parameters) { close:function() { if(settings.hideOnScroll === true || settings.hideOnScroll == 'auto' && settings.on != 'click') { $document - .one('touchmove' + eventNamespace, module.hideGracefully) - .one('scroll' + eventNamespace, module.hideGracefully) + .one(module.get.scrollEvent() + elementNamespace, module.hideGracefully) ; $context - .one('touchmove' + eventNamespace, module.hideGracefully) - .one('scroll' + eventNamespace, module.hideGracefully) + .one(module.get.scrollEvent() + elementNamespace, module.hideGracefully) ; } if(settings.on == 'click' && settings.closable) { module.verbose('Binding popup close event to document'); $document - .on('click' + eventNamespace, function(event) { + .on('click' + elementNamespace, function(event) { module.verbose('Pop-up clickaway intent detected'); module.hideGracefully.call(element, event); }) @@ -820,16 +855,16 @@ module.exports = function(parameters) { close: function() { if(settings.hideOnScroll === true || settings.hideOnScroll == 'auto' && settings.on != 'click') { $document - .off('scroll' + eventNamespace, module.hide) + .off('scroll' + elementNamespace, module.hide) ; $context - .off('scroll' + eventNamespace, module.hide) + .off('scroll' + elementNamespace, module.hide) ; } if(settings.on == 'click' && settings.closable) { module.verbose('Removing close event from document'); $document - .off('click' + eventNamespace) + .off('click' + elementNamespace) ; } } @@ -1076,6 +1111,7 @@ module.exports.settings = { on : 'hover', closable : true, hideOnScroll : 'auto', + exclusive : true, context : 'body', @@ -1112,6 +1148,7 @@ module.exports.settings = { }, metadata: { + activator : 'activator', content : 'content', html : 'html', offset : 'offset', diff --git a/package.js b/package.js index 174a2df..ae3ee3a 100755 --- a/package.js +++ b/package.js @@ -2,7 +2,7 @@ Package.describe({ name : 'semantic:ui-popup', summary : 'Semantic UI - Popup: Single component release', - version : '1.10.3', + version : '1.11.0', git : 'git://github.com/Semantic-Org/UI-Popup.git', }); diff --git a/package.json b/package.json index 8ddbd46..c2e39e1 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "semantic-ui-popup", - "version": "1.10.3", + "version": "1.11.0", "title": "Semantic UI - Popup", "description": "Single component release of popup", "homepage": "http://www.semantic-ui.com", diff --git a/popup.css b/popup.css index 0fcacd9..484bfad 100755 --- a/popup.css +++ b/popup.css @@ -1,5 +1,5 @@ /*! - * # Semantic UI 1.10.3 - Popup + * # Semantic UI 1.11.0 - Popup * http://github.com/semantic-org/semantic-ui/ * * diff --git a/popup.js b/popup.js index 1f52e52..432e9e5 100755 --- a/popup.js +++ b/popup.js @@ -1,5 +1,5 @@ /*! - * # Semantic UI 1.10.3 - Popup + * # Semantic UI 1.11.0 - Popup * http://github.com/semantic-org/semantic-ui/ * * @@ -62,6 +62,9 @@ $.fn.popup = function(parameters) { element = this, instance = $module.data(moduleNamespace), + + elementNamespace, + id, module ; @@ -69,24 +72,9 @@ $.fn.popup = function(parameters) { // binds events initialize: function() { - module.debug('Initializing module', $module); - if(settings.on == 'click') { - $module - .on('click' + eventNamespace, module.toggle) - ; - } - else if( module.get.startEvent() ) { - $module - .on(module.get.startEvent() + eventNamespace, module.event.start) - .on(module.get.endEvent() + eventNamespace, module.event.end) - ; - } - if(settings.target) { - module.debug('Target set to element', $target); - } - $window - .on('resize' + eventNamespace, module.event.resize) - ; + module.debug('Initializing', $module); + module.createID(); + module.bind.events(); if( !module.exists() && settings.preserve) { module.create(); } @@ -94,7 +82,7 @@ $.fn.popup = function(parameters) { }, instantiate: function() { - module.verbose('Storing instance of module', module); + module.verbose('Storing instance', module); instance = module; $module .data(moduleNamespace, instance) @@ -143,11 +131,15 @@ $.fn.popup = function(parameters) { destroy: function() { module.debug('Destroying previous module'); + // remove element only if was created dynamically if($popup && !settings.preserve) { module.removePopup(); } + // clear all timeouts clearTimeout(module.hideTimer); clearTimeout(module.showTimer); + // remove events + $window.off(elementNamespace); $module .off(eventNamespace) .removeData(moduleNamespace) @@ -207,6 +199,7 @@ $.fn.popup = function(parameters) { $popup = $('
') .addClass(className.popup) .addClass(variation) + .data(metadata.activator, $module) .html(html) ; if(variation) { @@ -235,13 +228,14 @@ $.fn.popup = function(parameters) { else if($target.next(selector.popup).length !== 0) { module.verbose('Pre-existing popup found'); settings.inline = true; - settings.popup = $target.next(selector.popup); + settings.popup = $target.next(selector.popup).data(metadata.activator, $module); module.refresh(); if(settings.hoverable) { module.bind.popup(); } } else if(settings.popup) { + settings.popup.data(metadata.activator, $module); module.verbose('Used popup specified in settings'); module.refresh(); if(settings.hoverable) { @@ -253,13 +247,18 @@ $.fn.popup = function(parameters) { } }, + createID: function() { + id = (Math.random().toString(16) + '000000000').substr(2,8); + elementNamespace = '.' + id; + module.verbose('Creating unique id for element', id); + }, + // determines popup state toggle: function() { module.debug('Toggling pop-up'); if( module.is.hidden() ) { module.debug('Popup is hidden, showing pop-up'); module.unbind.close(); - module.hideAll(); module.show(); } else { @@ -279,6 +278,9 @@ $.fn.popup = function(parameters) { } if( $popup && module.set.position() ) { module.save.conditions(); + if(settings.exclusive) { + module.hideAll(); + } module.animate.show(callback); } }, @@ -296,8 +298,13 @@ $.fn.popup = function(parameters) { hideAll: function() { $(selector.popup) - .filter(':visible') - .transition(settings.transition) + .filter('.' + className.visible) + .each(function() { + $(this) + .data(metadata.activator) + .popup('hide') + ; + }) ; }, @@ -423,15 +430,27 @@ $.fn.popup = function(parameters) { }, get: { + id: function() { + return id; + }, startEvent: function() { if(settings.on == 'hover') { - return 'mouseenter'; + return (hasTouch) + ? 'touchstart mouseenter' + : 'mouseenter' + ; } else if(settings.on == 'focus') { return 'focus'; } return false; }, + scrollEvent: function() { + return (hasTouch) + ? 'touchmove scroll' + : 'scroll' + ; + }, endEvent: function() { if(settings.on == 'hover') { return 'mouseleave'; @@ -741,7 +760,7 @@ $.fn.popup = function(parameters) { } else if(!settings.lastResort) { module.debug('Popup could not find a position in view', $popup); - module.error(error.cannotPlace); + module.error(error.cannotPlace, element); module.remove.attempts(); module.remove.loading(); module.reset(); @@ -782,6 +801,24 @@ $.fn.popup = function(parameters) { }, bind: { + events: function() { + module.debug('Binding popup events to module'); + if(settings.on == 'click') { + $module + .on('click' + eventNamespace, module.toggle) + ; + } + else if( module.get.startEvent() ) { + $module + .on(module.get.startEvent() + eventNamespace, module.event.start) + .on(module.get.endEvent() + eventNamespace, module.event.end) + ; + } + if(settings.target) { + module.debug('Target set to element', $target); + } + $window.on('resize' + elementNamespace, module.event.resize); + }, popup: function() { module.verbose('Allowing hover events on popup to prevent closing'); if( $popup && module.has.popup() ) { @@ -794,18 +831,16 @@ $.fn.popup = function(parameters) { close:function() { if(settings.hideOnScroll === true || settings.hideOnScroll == 'auto' && settings.on != 'click') { $document - .one('touchmove' + eventNamespace, module.hideGracefully) - .one('scroll' + eventNamespace, module.hideGracefully) + .one(module.get.scrollEvent() + elementNamespace, module.hideGracefully) ; $context - .one('touchmove' + eventNamespace, module.hideGracefully) - .one('scroll' + eventNamespace, module.hideGracefully) + .one(module.get.scrollEvent() + elementNamespace, module.hideGracefully) ; } if(settings.on == 'click' && settings.closable) { module.verbose('Binding popup close event to document'); $document - .on('click' + eventNamespace, function(event) { + .on('click' + elementNamespace, function(event) { module.verbose('Pop-up clickaway intent detected'); module.hideGracefully.call(element, event); }) @@ -818,16 +853,16 @@ $.fn.popup = function(parameters) { close: function() { if(settings.hideOnScroll === true || settings.hideOnScroll == 'auto' && settings.on != 'click') { $document - .off('scroll' + eventNamespace, module.hide) + .off('scroll' + elementNamespace, module.hide) ; $context - .off('scroll' + eventNamespace, module.hide) + .off('scroll' + elementNamespace, module.hide) ; } if(settings.on == 'click' && settings.closable) { module.verbose('Removing close event from document'); $document - .off('click' + eventNamespace) + .off('click' + elementNamespace) ; } } @@ -1074,6 +1109,7 @@ $.fn.popup.settings = { on : 'hover', closable : true, hideOnScroll : 'auto', + exclusive : true, context : 'body', @@ -1110,6 +1146,7 @@ $.fn.popup.settings = { }, metadata: { + activator : 'activator', content : 'content', html : 'html', offset : 'offset', diff --git a/popup.min.css b/popup.min.css index bf21b69..7de6c43 100755 --- a/popup.min.css +++ b/popup.min.css @@ -1,5 +1,5 @@ /*! - * # Semantic UI 1.10.3 - Popup + * # Semantic UI 1.11.0 - Popup * http://github.com/semantic-org/semantic-ui/ * * @@ -7,4 +7,4 @@ * Released under the MIT license * http://opensource.org/licenses/MIT * - */.ui.popup{display:none;position:absolute;top:0;right:0;min-width:-moz-max-content;z-index:1900;border:1px solid #ccc;max-width:250px;background-color:#fff;padding:.833em 1em;font-weight:400;font-style:normal;color:rgba(0,0,0,.8);border-radius:.2857rem;box-shadow:0 2px 4px rgba(0,0,0,.1)}.ui.popup>.header{padding:0;font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;font-size:1.125em;line-height:1.2;font-weight:700}.ui.popup>.header+.content{padding-top:.5em}.ui.popup:before{position:absolute;content:'';width:.75em;height:.75em;background:#fff;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);z-index:2;box-shadow:1px 1px 0 0 #b3b3b3}.ui.popup{margin:0}.ui.popup.bottom{margin:.75em 0 0}.ui.popup.top{margin:0 0 .75em}.ui.popup.left.center{margin:0 .75em 0 0}.ui.popup.right.center{margin:0 0 0 .75em}.ui.bottom.center.popup:before{margin-left:-.325em;top:-.325em;left:50%;right:auto;bottom:auto;box-shadow:-1px -1px 0 0 #b3b3b3}.ui.bottom.left.popup{margin-left:0}.ui.bottom.left.popup:before{top:-.325em;left:1em;right:auto;bottom:auto;margin-left:0;box-shadow:-1px -1px 0 0 #b3b3b3}.ui.bottom.right.popup{margin-right:0}.ui.bottom.right.popup:before{top:-.325em;right:1em;bottom:auto;left:auto;margin-left:0;box-shadow:-1px -1px 0 0 #b3b3b3}.ui.top.center.popup:before{top:auto;right:auto;bottom:-.325em;left:50%;margin-left:-.325em}.ui.top.left.popup{margin-left:0}.ui.top.left.popup:before{bottom:-.325em;left:1em;top:auto;right:auto;margin-left:0}.ui.top.right.popup{margin-right:0}.ui.top.right.popup:before{bottom:-.325em;right:1em;top:auto;left:auto;margin-left:0}.ui.left.center.popup:before{top:50%;right:-.325em;bottom:auto;left:auto;margin-top:-.325em;box-shadow:1px -1px 0 0 #b3b3b3}.ui.right.center.popup:before{top:50%;left:-.325em;bottom:auto;right:auto;margin-top:-.325em;box-shadow:-1px 1px 0 0 #b3b3b3}.ui.popup>.ui.grid:not(.padded){width:-webkit-calc(100% + 1.75rem);width:calc(100% + 1.75rem);margin:-.7rem -.875rem}.ui.loading.popup{display:block;visibility:hidden;z-index:-1}.ui.animating.popup,.ui.visible.popup{display:block}.ui.basic.popup:before{display:none}.ui.wide.popup{max-width:350px}.ui[class*="very wide"].popup{max-width:550px}.ui.fluid.popup{width:100%;max-width:none}.ui.inverted.popup{background:#1b1c1d;color:#fff;border:none;box-shadow:none}.ui.inverted.popup .header{background-color:none;color:#fff}.ui.inverted.popup:before{background-color:#1b1c1d;box-shadow:none!important}.ui.flowing.popup{max-width:none}.ui.small.popup{font-size:.785714rem}.ui.popup{font-size:.85714rem}.ui.large.popup{font-size:1rem}.ui.huge.popup{font-size:1.14285rem} \ No newline at end of file + */.ui.popup{display:none;position:absolute;top:0;right:0;min-width:-moz-max-content;z-index:1900;border:1px solid #ccc;max-width:250px;background-color:#fff;padding:.833em 1em;font-weight:400;font-style:normal;color:rgba(0,0,0,.8);border-radius:.2857rem;box-shadow:0 2px 4px rgba(0,0,0,.1);margin:0}.ui.bottom.center.popup:before,.ui.bottom.left.popup:before,.ui.bottom.right.popup:before{box-shadow:-1px -1px 0 0 #b3b3b3;top:-.325em}.ui.popup>.header{padding:0;font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;font-size:1.125em;line-height:1.2;font-weight:700}.ui.popup>.header+.content{padding-top:.5em}.ui.popup:before{position:absolute;content:'';width:.75em;height:.75em;background:#fff;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);z-index:2;box-shadow:1px 1px 0 0 #b3b3b3}.ui.popup.bottom{margin:.75em 0 0}.ui.popup.top{margin:0 0 .75em}.ui.popup.left.center{margin:0 .75em 0 0}.ui.popup.right.center{margin:0 0 0 .75em}.ui.bottom.right.popup,.ui.top.right.popup{margin-right:0}.ui.bottom.center.popup:before{margin-left:-.325em;left:50%;right:auto;bottom:auto}.ui.bottom.left.popup{margin-left:0}.ui.bottom.left.popup:before{left:1em;right:auto;bottom:auto;margin-left:0}.ui.bottom.right.popup:before{right:1em;bottom:auto;left:auto;margin-left:0}.ui.top.center.popup:before{top:auto;right:auto;bottom:-.325em;left:50%;margin-left:-.325em}.ui.top.left.popup{margin-left:0}.ui.top.left.popup:before{bottom:-.325em;left:1em;top:auto;right:auto;margin-left:0}.ui.top.right.popup:before{bottom:-.325em;right:1em;top:auto;left:auto;margin-left:0}.ui.left.center.popup:before{top:50%;right:-.325em;bottom:auto;left:auto;margin-top:-.325em;box-shadow:1px -1px 0 0 #b3b3b3}.ui.right.center.popup:before{top:50%;left:-.325em;bottom:auto;right:auto;margin-top:-.325em;box-shadow:-1px 1px 0 0 #b3b3b3}.ui.popup>.ui.grid:not(.padded){width:-webkit-calc(100% + 1.75rem);width:calc(100% + 1.75rem);margin:-.7rem -.875rem}.ui.loading.popup{display:block;visibility:hidden;z-index:-1}.ui.animating.popup,.ui.visible.popup{display:block}.ui.basic.popup:before{display:none}.ui.wide.popup{max-width:350px}.ui[class*="very wide"].popup{max-width:550px}.ui.fluid.popup{width:100%;max-width:none}.ui.inverted.popup{background:#1b1c1d;color:#fff;border:none;box-shadow:none}.ui.inverted.popup .header{background-color:none;color:#fff}.ui.inverted.popup:before{background-color:#1b1c1d;box-shadow:none!important}.ui.flowing.popup{max-width:none}.ui.small.popup{font-size:.785714rem}.ui.popup{font-size:.85714rem}.ui.large.popup{font-size:1rem}.ui.huge.popup{font-size:1.14285rem} \ No newline at end of file diff --git a/popup.min.js b/popup.min.js index 35e9088..ee33295 100755 --- a/popup.min.js +++ b/popup.min.js @@ -1,5 +1,5 @@ /*! - * # Semantic UI 1.10.3 - Popup + * # Semantic UI 1.11.0 - Popup * http://github.com/semantic-org/semantic-ui/ * * @@ -8,4 +8,4 @@ * http://opensource.org/licenses/MIT * */ -!function(e,t,o,n){"use strict";e.fn.popup=function(i){var s,r=e(this),a=e(o),l=r.selector||"",p=("ontouchstart"in o.documentElement,(new Date).getTime()),u=[],c=arguments[0],d="string"==typeof c,f=[].slice.call(arguments,1);return r.each(function(){var o,r,g,h=e.isPlainObject(i)?e.extend(!0,{},e.fn.popup.settings,i):e.extend({},e.fn.popup.settings),m=h.selector,b=h.className,v=h.error,y=h.metadata,w=h.namespace,P="."+h.namespace,T="module-"+w,C=e(this),k=e(h.context),x=h.target?e(h.target):C,S=e(t),O=e("body"),j=0,A=!1,R=this,E=C.data(T);g={initialize:function(){g.debug("Initializing module",C),"click"==h.on?C.on("click"+P,g.toggle):g.get.startEvent()&&C.on(g.get.startEvent()+P,g.event.start).on(g.get.endEvent()+P,g.event.end),h.target&&g.debug("Target set to element",x),S.on("resize"+P,g.event.resize),!g.exists()&&h.preserve&&g.create(),g.instantiate()},instantiate:function(){g.verbose("Storing instance of module",g),E=g,C.data(T,E)},refresh:function(){h.popup?o=e(h.popup).eq(0):h.inline&&(o=x.next(m.popup).eq(0)),h.popup?(o.addClass(b.loading),r=g.get.offsetParent(),o.removeClass(b.loading),h.movePopup&&g.has.popup()&&g.get.offsetParent(o)[0]!==r[0]&&(g.debug("Moving popup to the same offset parent as activating element"),o.detach().appendTo(r))):r=h.inline?g.get.offsetParent(x):g.has.popup()?g.get.offsetParent(o):O,r.is("html")&&(g.debug("Setting page as offset parent"),r=O)},reposition:function(){g.refresh(),g.set.position()},destroy:function(){g.debug("Destroying previous module"),o&&!h.preserve&&g.removePopup(),clearTimeout(g.hideTimer),clearTimeout(g.showTimer),C.off(P).removeData(T)},event:{start:function(){var t=e.isPlainObject(h.delay)?h.delay.show:h.delay;clearTimeout(g.hideTimer),g.showTimer=setTimeout(function(){!g.is.hidden()||g.is.active()&&g.is.dropdown()||g.show()},t)},end:function(){var t=e.isPlainObject(h.delay)?h.delay.hide:h.delay;clearTimeout(g.showTimer),g.hideTimer=setTimeout(function(){g.is.visible()&&g.hide()},t)},resize:function(){g.is.visible()&&g.set.position()}},create:function(){var t=C.data(y.html)||h.html,n=C.data(y.variation)||h.variation,i=C.data(y.title)||h.title,s=C.data(y.content)||C.attr("title")||h.content;t||s||i?(g.debug("Creating pop-up html"),t||(t=h.templates.popup({title:i,content:s})),o=e("
").addClass(b.popup).addClass(n).html(t),n&&o.addClass(n),h.inline?(g.verbose("Inserting popup element inline",o),o.insertAfter(C)):(g.verbose("Appending popup element to body",o),o.appendTo(k)),g.refresh(),h.hoverable&&g.bind.popup(),h.onCreate.call(o,R)):0!==x.next(m.popup).length?(g.verbose("Pre-existing popup found"),h.inline=!0,h.popup=x.next(m.popup),g.refresh(),h.hoverable&&g.bind.popup()):h.popup?(g.verbose("Used popup specified in settings"),g.refresh(),h.hoverable&&g.bind.popup()):g.debug("No content specified skipping display",R)},toggle:function(){g.debug("Toggling pop-up"),g.is.hidden()?(g.debug("Popup is hidden, showing pop-up"),g.unbind.close(),g.hideAll(),g.show()):(g.debug("Popup is visible, hiding pop-up"),g.hide())},show:function(t){t=e.isFunction(t)?t:function(){},g.debug("Showing pop-up",h.transition),g.exists()?h.preserve||h.popup||g.refresh():g.create(),o&&g.set.position()&&(g.save.conditions(),g.animate.show(t))},hide:function(t){t=e.isFunction(t)?t:function(){},g.remove.visible(),g.unbind.close(),g.is.visible()&&(g.restore.conditions(),g.animate.hide(t))},hideAll:function(){e(m.popup).filter(":visible").transition(h.transition)},hideGracefully:function(t){t&&0===e(t.target).closest(m.popup).length?(g.debug("Click occurred outside popup hiding popup"),g.hide()):g.debug("Click was inside popup, keeping popup open")},exists:function(){return o?h.inline||h.popup?g.has.popup():o.closest(k).length>=1?!0:!1:!1},removePopup:function(){g.debug("Removing popup",o),g.has.popup()&&!h.popup&&(o.remove(),o=n),h.onRemove.call(o,R)},save:{conditions:function(){g.cache={title:C.attr("title")},g.cache.title&&C.removeAttr("title"),g.verbose("Saving original attributes",g.cache.title)}},restore:{conditions:function(){return g.cache&&g.cache.title&&(C.attr("title",g.cache.title),g.verbose("Restoring original attributes",g.cache.title)),!0}},animate:{show:function(t){t=e.isFunction(t)?t:function(){},h.transition&&e.fn.transition!==n&&C.transition("is supported")?(g.set.visible(),o.transition({animation:h.transition+" in",queue:!1,debug:h.debug,verbose:h.verbose,duration:h.duration,onComplete:function(){g.bind.close(),t.call(o,R),h.onVisible.call(o,R)}})):(g.set.visible(),o.stop().fadeIn(h.duration,h.easing,function(){g.bind.close(),t.call(o,R),h.onVisible.call(o,R)})),h.onShow.call(o,R)},hide:function(t){t=e.isFunction(t)?t:function(){},g.debug("Hiding pop-up"),h.transition&&e.fn.transition!==n&&C.transition("is supported")?o.transition({animation:h.transition+" out",queue:!1,duration:h.duration,debug:h.debug,verbose:h.verbose,onComplete:function(){g.reset(),t.call(o,R),h.onHidden.call(o,R)}}):o.stop().fadeOut(h.duration,h.easing,function(){g.reset(),t.call(o,R),h.onHidden.call(o,R)}),h.onHide.call(o,R)}},get:{startEvent:function(){return"hover"==h.on?"mouseenter":"focus"==h.on?"focus":!1},endEvent:function(){return"hover"==h.on?"mouseleave":"focus"==h.on?"blur":!1},offsetParent:function(t){var o=t!==n?t[0]:C[0],i=o.parentNode,s=e(i);if(i)for(var r="none"===s.css("transform"),a="static"===s.css("position"),l=s.is("html");i&&!l&&a&&r;)i=i.parentNode,s=e(i),r="none"===s.css("transform"),a="static"===s.css("position"),l=s.is("html");return s&&s.length>0?s:e()},offstagePosition:function(n){var i={top:e(t).scrollTop(),bottom:e(t).scrollTop()+e(t).height(),left:0,right:e(t).width()},s={width:o.width(),height:o.height(),offset:o.offset()},r={},a=[];return n=n||!1,s.offset&&n&&(g.verbose("Checking if outside viewable area",s.offset),r={top:s.offset.topi.bottom,right:s.offset.left+s.width>i.right,left:s.offset.left0?a.join(" "):!1},positions:function(){return{"top left":!1,"top center":!1,"top right":!1,"bottom left":!1,"bottom center":!1,"bottom right":!1,"left center":!1,"right center":!1}},nextPosition:function(e){var t=e.split(" "),o=t[0],n=t[1],i={top:"bottom",bottom:"top",left:"right",right:"left"},s={left:"center",center:"right",right:"left"},r={"top left":"top center","top center":"top right","top right":"right center","right center":"bottom right","bottom right":"bottom center","bottom center":"bottom left","bottom left":"left center","left center":"top left"},a="top"==o||"bottom"==o,l=!1,p=!1,u=!1;return A||(g.verbose("All available positions available"),A=g.get.positions()),g.debug("Recording last position tried",e),A[e]=!0,"opposite"===h.prefer&&(u=[i[o],n],u=u.join(" "),l=A[u]===!0,g.debug("Trying opposite strategy",u)),"adjacent"===h.prefer&&a&&(u=[o,s[n]],u=u.join(" "),p=A[u]===!0,g.debug("Trying adjacent strategy",u)),(p||l)&&(g.debug("Using backup position",u),u=r[e]),u}},set:{position:function(i,s){var a,l,p,u=(e(t).width(),e(t).height(),x.outerWidth()),c=x.outerHeight(),d=o.outerWidth(),f=o.outerHeight(),m=r.outerWidth(),w=r.outerHeight(),P=h.distanceAway,T=x[0],k=h.inline?parseInt(t.getComputedStyle(T).getPropertyValue("margin-top"),10):0,S=h.inline?parseInt(t.getComputedStyle(T).getPropertyValue(g.is.rtl()?"margin-right":"margin-left"),10):0,O=h.inline||h.popup?x.position():x.offset();switch(i=i||C.data(y.position)||h.position,s=s||C.data(y.offset)||h.offset,j==h.maxSearchDepth&&h.lastResort&&(g.debug("Using last resort position to display",h.lastResort),i=h.lastResort),h.inline&&(g.debug("Adding targets margin to calculation"),"left center"==i||"right center"==i?(s+=k,P+=-S):"top left"==i||"top center"==i||"top right"==i?(s+=S,P-=k):(s+=S,P+=k)),g.debug("Calculating popup positioning",i),a=i,g.is.rtl()&&(a=a.replace(/left|right/g,function(e){return"left"==e?"right":"left"}),g.debug("RTL: Popup positioning updated",a)),a){case"top left":l={top:"auto",bottom:w-O.top+P,left:O.left+s,right:"auto"};break;case"top center":l={bottom:w-O.top+P,left:O.left+u/2-d/2+s,top:"auto",right:"auto"};break;case"top right":l={bottom:w-O.top+P,right:m-O.left-u-s,top:"auto",left:"auto"};break;case"left center":l={top:O.top+c/2-f/2+s,right:m-O.left+P,left:"auto",bottom:"auto"};break;case"right center":l={top:O.top+c/2-f/2+s,left:O.left+u+P,bottom:"auto",right:"auto"};break;case"bottom left":l={top:O.top+c+P,left:O.left+s,bottom:"auto",right:"auto"};break;case"bottom center":l={top:O.top+c+P,left:O.left+u/2-d/2+s,bottom:"auto",right:"auto"};break;case"bottom right":l={top:O.top+c+P,right:m-O.left-u-s,left:"auto",bottom:"auto"}}if(l===n&&g.error(v.invalidPosition,i),g.debug("Calculated popup positioning values",l),o.css(l).removeClass(b.position).addClass(i).addClass(b.loading),p=g.get.offstagePosition(i)){if(g.debug("Popup cant fit into viewport",p),j0}},is:{active:function(){return C.hasClass(b.active)},animating:function(){return o&&o.is(":animated")||o.hasClass(b.animating)},visible:function(){return o&&o.is(":visible")},dropdown:function(){return C.hasClass(b.dropdown)},hidden:function(){return!g.is.visible()},rtl:function(){return"rtl"==C.css("direction")}},reset:function(){g.remove.visible(),h.preserve?e.fn.transition!==n&&o.transition("remove transition"):g.removePopup()},setting:function(t,o){if(e.isPlainObject(t))e.extend(!0,h,t);else{if(o===n)return h[t];h[t]=o}},internal:function(t,o){if(e.isPlainObject(t))e.extend(!0,g,t);else{if(o===n)return g[t];g[t]=o}},debug:function(){h.debug&&(h.performance?g.performance.log(arguments):(g.debug=Function.prototype.bind.call(console.info,console,h.name+":"),g.debug.apply(console,arguments)))},verbose:function(){h.verbose&&h.debug&&(h.performance?g.performance.log(arguments):(g.verbose=Function.prototype.bind.call(console.info,console,h.name+":"),g.verbose.apply(console,arguments)))},error:function(){g.error=Function.prototype.bind.call(console.error,console,h.name+":"),g.error.apply(console,arguments)},performance:{log:function(e){var t,o,n;h.performance&&(t=(new Date).getTime(),n=p||t,o=t-n,p=t,u.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:R,"Execution Time":o})),clearTimeout(g.performance.timer),g.performance.timer=setTimeout(g.performance.display,100)},display:function(){var t=h.name+":",o=0;p=!1,clearTimeout(g.performance.timer),e.each(u,function(e,t){o+=t["Execution Time"]}),t+=" "+o+"ms",l&&(t+=" '"+l+"'"),(console.group!==n||console.table!==n)&&u.length>0&&(console.groupCollapsed(t),console.table?console.table(u):e.each(u,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),u=[]}},invoke:function(t,o,i){var r,a,l,p=E;return o=o||f,i=R||i,"string"==typeof t&&p!==n&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(o,i){var s=o!=r?i+t[o+1].charAt(0).toUpperCase()+t[o+1].slice(1):t;if(e.isPlainObject(p[s])&&o!=r)p=p[s];else{if(p[s]!==n)return a=p[s],!1;if(!e.isPlainObject(p[i])||o==r)return p[i]!==n?(a=p[i],!1):!1;p=p[i]}})),e.isFunction(a)?l=a.apply(i,o):a!==n&&(l=a),e.isArray(s)?s.push(l):s!==n?s=[s,l]:l!==n&&(s=l),a}},d?(E===n&&g.initialize(),g.invoke(c)):(E!==n&&E.invoke("destroy"),g.initialize())}),s!==n?s:this},e.fn.popup.settings={name:"Popup",debug:!1,verbose:!0,performance:!0,namespace:"popup",onCreate:function(){},onRemove:function(){},onShow:function(){},onVisible:function(){},onHide:function(){},onHidden:function(){},variation:"",content:!1,html:!1,title:!1,on:"hover",closable:!0,hideOnScroll:"auto",context:"body",position:"top left",prefer:"opposite",lastResort:!1,delay:{show:30,hide:0},setFluidWidth:!0,movePopup:!0,target:!1,popup:!1,inline:!1,preserve:!1,hoverable:!1,duration:200,easing:"easeOutQuint",transition:"scale",distanceAway:0,offset:0,maxSearchDepth:20,error:{invalidPosition:"The position you specified is not a valid position",cannotPlace:"No visible position could be found for the popup",method:"The method you called is not defined."},metadata:{content:"content",html:"html",offset:"offset",position:"position",title:"title",variation:"variation"},className:{active:"active",animating:"animating",dropdown:"dropdown",fluid:"fluid",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(e){var t=/[&<>"'`]/g,o=/[&<>"'`]/,n={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},i=function(e){return n[e]};return o.test(e)?e.replace(t,i):e},popup:function(t){var o="",i=e.fn.popup.settings.templates.escape;return typeof t!==n&&(typeof t.title!==n&&t.title&&(t.title=i(t.title),o+='
'+t.title+"
"),typeof t.content!==n&&t.content&&(t.content=i(t.content),o+='
'+t.content+"
")),o}}},e.extend(e.easing,{easeOutQuad:function(e,t,o,n,i){return-n*(t/=i)*(t-2)+o}})}(jQuery,window,document); \ No newline at end of file +!function(e,t,o,n){"use strict";e.fn.popup=function(i){var r,s=e(this),a=e(o),p=s.selector||"",l="ontouchstart"in o.documentElement,u=(new Date).getTime(),c=[],d=arguments[0],f="string"==typeof d,g=[].slice.call(arguments,1);return s.each(function(){var o,s,h,m,b,v=e.isPlainObject(i)?e.extend(!0,{},e.fn.popup.settings,i):e.extend({},e.fn.popup.settings),y=v.selector,w=v.className,P=v.error,T=v.metadata,C=v.namespace,x="."+v.namespace,k="module-"+C,S=e(this),O=e(v.context),E=v.target?e(v.target):S,j=e(t),A=e("body"),R=0,F=!1,D=this,H=S.data(k);b={initialize:function(){b.debug("Initializing",S),b.createID(),b.bind.events(),!b.exists()&&v.preserve&&b.create(),b.instantiate()},instantiate:function(){b.verbose("Storing instance",b),H=b,S.data(k,H)},refresh:function(){v.popup?o=e(v.popup).eq(0):v.inline&&(o=E.next(y.popup).eq(0)),v.popup?(o.addClass(w.loading),s=b.get.offsetParent(),o.removeClass(w.loading),v.movePopup&&b.has.popup()&&b.get.offsetParent(o)[0]!==s[0]&&(b.debug("Moving popup to the same offset parent as activating element"),o.detach().appendTo(s))):s=v.inline?b.get.offsetParent(E):b.has.popup()?b.get.offsetParent(o):A,s.is("html")&&(b.debug("Setting page as offset parent"),s=A)},reposition:function(){b.refresh(),b.set.position()},destroy:function(){b.debug("Destroying previous module"),o&&!v.preserve&&b.removePopup(),clearTimeout(b.hideTimer),clearTimeout(b.showTimer),j.off(h),S.off(x).removeData(k)},event:{start:function(){var t=e.isPlainObject(v.delay)?v.delay.show:v.delay;clearTimeout(b.hideTimer),b.showTimer=setTimeout(function(){!b.is.hidden()||b.is.active()&&b.is.dropdown()||b.show()},t)},end:function(){var t=e.isPlainObject(v.delay)?v.delay.hide:v.delay;clearTimeout(b.showTimer),b.hideTimer=setTimeout(function(){b.is.visible()&&b.hide()},t)},resize:function(){b.is.visible()&&b.set.position()}},create:function(){var t=S.data(T.html)||v.html,n=S.data(T.variation)||v.variation,i=S.data(T.title)||v.title,r=S.data(T.content)||S.attr("title")||v.content;t||r||i?(b.debug("Creating pop-up html"),t||(t=v.templates.popup({title:i,content:r})),o=e("
").addClass(w.popup).addClass(n).data(T.activator,S).html(t),n&&o.addClass(n),v.inline?(b.verbose("Inserting popup element inline",o),o.insertAfter(S)):(b.verbose("Appending popup element to body",o),o.appendTo(O)),b.refresh(),v.hoverable&&b.bind.popup(),v.onCreate.call(o,D)):0!==E.next(y.popup).length?(b.verbose("Pre-existing popup found"),v.inline=!0,v.popup=E.next(y.popup).data(T.activator,S),b.refresh(),v.hoverable&&b.bind.popup()):v.popup?(v.popup.data(T.activator,S),b.verbose("Used popup specified in settings"),b.refresh(),v.hoverable&&b.bind.popup()):b.debug("No content specified skipping display",D)},createID:function(){m=(Math.random().toString(16)+"000000000").substr(2,8),h="."+m,b.verbose("Creating unique id for element",m)},toggle:function(){b.debug("Toggling pop-up"),b.is.hidden()?(b.debug("Popup is hidden, showing pop-up"),b.unbind.close(),b.show()):(b.debug("Popup is visible, hiding pop-up"),b.hide())},show:function(t){t=e.isFunction(t)?t:function(){},b.debug("Showing pop-up",v.transition),b.exists()?v.preserve||v.popup||b.refresh():b.create(),o&&b.set.position()&&(b.save.conditions(),v.exclusive&&b.hideAll(),b.animate.show(t))},hide:function(t){t=e.isFunction(t)?t:function(){},b.remove.visible(),b.unbind.close(),b.is.visible()&&(b.restore.conditions(),b.animate.hide(t))},hideAll:function(){e(y.popup).filter("."+w.visible).each(function(){e(this).data(T.activator).popup("hide")})},hideGracefully:function(t){t&&0===e(t.target).closest(y.popup).length?(b.debug("Click occurred outside popup hiding popup"),b.hide()):b.debug("Click was inside popup, keeping popup open")},exists:function(){return o?v.inline||v.popup?b.has.popup():o.closest(O).length>=1?!0:!1:!1},removePopup:function(){b.debug("Removing popup",o),b.has.popup()&&!v.popup&&(o.remove(),o=n),v.onRemove.call(o,D)},save:{conditions:function(){b.cache={title:S.attr("title")},b.cache.title&&S.removeAttr("title"),b.verbose("Saving original attributes",b.cache.title)}},restore:{conditions:function(){return b.cache&&b.cache.title&&(S.attr("title",b.cache.title),b.verbose("Restoring original attributes",b.cache.title)),!0}},animate:{show:function(t){t=e.isFunction(t)?t:function(){},v.transition&&e.fn.transition!==n&&S.transition("is supported")?(b.set.visible(),o.transition({animation:v.transition+" in",queue:!1,debug:v.debug,verbose:v.verbose,duration:v.duration,onComplete:function(){b.bind.close(),t.call(o,D),v.onVisible.call(o,D)}})):(b.set.visible(),o.stop().fadeIn(v.duration,v.easing,function(){b.bind.close(),t.call(o,D),v.onVisible.call(o,D)})),v.onShow.call(o,D)},hide:function(t){t=e.isFunction(t)?t:function(){},b.debug("Hiding pop-up"),v.transition&&e.fn.transition!==n&&S.transition("is supported")?o.transition({animation:v.transition+" out",queue:!1,duration:v.duration,debug:v.debug,verbose:v.verbose,onComplete:function(){b.reset(),t.call(o,D),v.onHidden.call(o,D)}}):o.stop().fadeOut(v.duration,v.easing,function(){b.reset(),t.call(o,D),v.onHidden.call(o,D)}),v.onHide.call(o,D)}},get:{id:function(){return m},startEvent:function(){return"hover"==v.on?l?"touchstart mouseenter":"mouseenter":"focus"==v.on?"focus":!1},scrollEvent:function(){return l?"touchmove scroll":"scroll"},endEvent:function(){return"hover"==v.on?"mouseleave":"focus"==v.on?"blur":!1},offsetParent:function(t){var o=t!==n?t[0]:S[0],i=o.parentNode,r=e(i);if(i)for(var s="none"===r.css("transform"),a="static"===r.css("position"),p=r.is("html");i&&!p&&a&&s;)i=i.parentNode,r=e(i),s="none"===r.css("transform"),a="static"===r.css("position"),p=r.is("html");return r&&r.length>0?r:e()},offstagePosition:function(n){var i={top:e(t).scrollTop(),bottom:e(t).scrollTop()+e(t).height(),left:0,right:e(t).width()},r={width:o.width(),height:o.height(),offset:o.offset()},s={},a=[];return n=n||!1,r.offset&&n&&(b.verbose("Checking if outside viewable area",r.offset),s={top:r.offset.topi.bottom,right:r.offset.left+r.width>i.right,left:r.offset.left0?a.join(" "):!1},positions:function(){return{"top left":!1,"top center":!1,"top right":!1,"bottom left":!1,"bottom center":!1,"bottom right":!1,"left center":!1,"right center":!1}},nextPosition:function(e){var t=e.split(" "),o=t[0],n=t[1],i={top:"bottom",bottom:"top",left:"right",right:"left"},r={left:"center",center:"right",right:"left"},s={"top left":"top center","top center":"top right","top right":"right center","right center":"bottom right","bottom right":"bottom center","bottom center":"bottom left","bottom left":"left center","left center":"top left"},a="top"==o||"bottom"==o,p=!1,l=!1,u=!1;return F||(b.verbose("All available positions available"),F=b.get.positions()),b.debug("Recording last position tried",e),F[e]=!0,"opposite"===v.prefer&&(u=[i[o],n],u=u.join(" "),p=F[u]===!0,b.debug("Trying opposite strategy",u)),"adjacent"===v.prefer&&a&&(u=[o,r[n]],u=u.join(" "),l=F[u]===!0,b.debug("Trying adjacent strategy",u)),(l||p)&&(b.debug("Using backup position",u),u=s[e]),u}},set:{position:function(i,r){var a,p,l,u=(e(t).width(),e(t).height(),E.outerWidth()),c=E.outerHeight(),d=o.outerWidth(),f=o.outerHeight(),g=s.outerWidth(),h=s.outerHeight(),m=v.distanceAway,y=E[0],C=v.inline?parseInt(t.getComputedStyle(y).getPropertyValue("margin-top"),10):0,x=v.inline?parseInt(t.getComputedStyle(y).getPropertyValue(b.is.rtl()?"margin-right":"margin-left"),10):0,k=v.inline||v.popup?E.position():E.offset();switch(i=i||S.data(T.position)||v.position,r=r||S.data(T.offset)||v.offset,R==v.maxSearchDepth&&v.lastResort&&(b.debug("Using last resort position to display",v.lastResort),i=v.lastResort),v.inline&&(b.debug("Adding targets margin to calculation"),"left center"==i||"right center"==i?(r+=C,m+=-x):"top left"==i||"top center"==i||"top right"==i?(r+=x,m-=C):(r+=x,m+=C)),b.debug("Calculating popup positioning",i),a=i,b.is.rtl()&&(a=a.replace(/left|right/g,function(e){return"left"==e?"right":"left"}),b.debug("RTL: Popup positioning updated",a)),a){case"top left":p={top:"auto",bottom:h-k.top+m,left:k.left+r,right:"auto"};break;case"top center":p={bottom:h-k.top+m,left:k.left+u/2-d/2+r,top:"auto",right:"auto"};break;case"top right":p={bottom:h-k.top+m,right:g-k.left-u-r,top:"auto",left:"auto"};break;case"left center":p={top:k.top+c/2-f/2+r,right:g-k.left+m,left:"auto",bottom:"auto"};break;case"right center":p={top:k.top+c/2-f/2+r,left:k.left+u+m,bottom:"auto",right:"auto"};break;case"bottom left":p={top:k.top+c+m,left:k.left+r,bottom:"auto",right:"auto"};break;case"bottom center":p={top:k.top+c+m,left:k.left+u/2-d/2+r,bottom:"auto",right:"auto"};break;case"bottom right":p={top:k.top+c+m,right:g-k.left-u-r,left:"auto",bottom:"auto"}}if(p===n&&b.error(P.invalidPosition,i),b.debug("Calculated popup positioning values",p),o.css(p).removeClass(w.position).addClass(i).addClass(w.loading),l=b.get.offstagePosition(i)){if(b.debug("Popup cant fit into viewport",l),R0}},is:{active:function(){return S.hasClass(w.active)},animating:function(){return o&&o.is(":animated")||o.hasClass(w.animating)},visible:function(){return o&&o.is(":visible")},dropdown:function(){return S.hasClass(w.dropdown)},hidden:function(){return!b.is.visible()},rtl:function(){return"rtl"==S.css("direction")}},reset:function(){b.remove.visible(),v.preserve?e.fn.transition!==n&&o.transition("remove transition"):b.removePopup()},setting:function(t,o){if(e.isPlainObject(t))e.extend(!0,v,t);else{if(o===n)return v[t];v[t]=o}},internal:function(t,o){if(e.isPlainObject(t))e.extend(!0,b,t);else{if(o===n)return b[t];b[t]=o}},debug:function(){v.debug&&(v.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,v.name+":"),b.debug.apply(console,arguments)))},verbose:function(){v.verbose&&v.debug&&(v.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),b.verbose.apply(console,arguments)))},error:function(){b.error=Function.prototype.bind.call(console.error,console,v.name+":"),b.error.apply(console,arguments)},performance:{log:function(e){var t,o,n;v.performance&&(t=(new Date).getTime(),n=u||t,o=t-n,u=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:D,"Execution Time":o})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var t=v.name+":",o=0;u=!1,clearTimeout(b.performance.timer),e.each(c,function(e,t){o+=t["Execution Time"]}),t+=" "+o+"ms",p&&(t+=" '"+p+"'"),(console.group!==n||console.table!==n)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,o,i){var s,a,p,l=H;return o=o||g,i=D||i,"string"==typeof t&&l!==n&&(t=t.split(/[\. ]/),s=t.length-1,e.each(t,function(o,i){var r=o!=s?i+t[o+1].charAt(0).toUpperCase()+t[o+1].slice(1):t;if(e.isPlainObject(l[r])&&o!=s)l=l[r];else{if(l[r]!==n)return a=l[r],!1;if(!e.isPlainObject(l[i])||o==s)return l[i]!==n?(a=l[i],!1):!1;l=l[i]}})),e.isFunction(a)?p=a.apply(i,o):a!==n&&(p=a),e.isArray(r)?r.push(p):r!==n?r=[r,p]:p!==n&&(r=p),a}},f?(H===n&&b.initialize(),b.invoke(d)):(H!==n&&H.invoke("destroy"),b.initialize())}),r!==n?r:this},e.fn.popup.settings={name:"Popup",debug:!1,verbose:!0,performance:!0,namespace:"popup",onCreate:function(){},onRemove:function(){},onShow:function(){},onVisible:function(){},onHide:function(){},onHidden:function(){},variation:"",content:!1,html:!1,title:!1,on:"hover",closable:!0,hideOnScroll:"auto",exclusive:!0,context:"body",position:"top left",prefer:"opposite",lastResort:!1,delay:{show:30,hide:0},setFluidWidth:!0,movePopup:!0,target:!1,popup:!1,inline:!1,preserve:!1,hoverable:!1,duration:200,easing:"easeOutQuint",transition:"scale",distanceAway:0,offset:0,maxSearchDepth:20,error:{invalidPosition:"The position you specified is not a valid position",cannotPlace:"No visible position could be found for the popup",method:"The method you called is not defined."},metadata:{activator:"activator",content:"content",html:"html",offset:"offset",position:"position",title:"title",variation:"variation"},className:{active:"active",animating:"animating",dropdown:"dropdown",fluid:"fluid",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(e){var t=/[&<>"'`]/g,o=/[&<>"'`]/,n={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},i=function(e){return n[e]};return o.test(e)?e.replace(t,i):e},popup:function(t){var o="",i=e.fn.popup.settings.templates.escape;return typeof t!==n&&(typeof t.title!==n&&t.title&&(t.title=i(t.title),o+='
'+t.title+"
"),typeof t.content!==n&&t.content&&(t.content=i(t.content),o+='
'+t.content+"
")),o}}},e.extend(e.easing,{easeOutQuad:function(e,t,o,n,i){return-n*(t/=i)*(t-2)+o}})}(jQuery,window,document); \ No newline at end of file