Callback for the event onAfterOpen raised by the popup.
@override
352036
function () {
            this.$DropDownListTrait._afterDropdownOpen.apply(this, arguments);
            if (this._cfg.waiAria) {
                var field = this.getTextInputField();
                var listWidget = this.controller.getListWidget();
                field.setAttribute("aria-owns", listWidget.getListDomId());
                var dropDownIcon = this._getDropdownIcon();
                if (dropDownIcon) {
                    dropDownIcon.setAttribute("aria-expanded", "true");
                }
                listWidget.afterWidgetLoaded({
                    fn: this._updateAriaActiveDescendant,
                    scope: this
                });
            }
        }
1013410
function (offset) {

            if (this.callbackID) {
                ariaCoreTimer.cancelCallback(this.callbackID);
                this.callbackID = null;
            }

            if (this._popup == null && this.ellipsesNeeded === true) {

                this.callbackID = ariaCoreTimer.addCallback({
                    fn : this._showPopup,
                    scope : this,
                    delay : 500,
                    args : offset
                });
            }
        }
405572
public void open() {
        setCutOutStyle();

        if (targetElement == null) {
            throw new IllegalStateException("The target element should be set before calling open().");
        }
        targetElement.scrollIntoView();

        if (computedBackgroundColor == null) {
            setupComputedBackgroundColor();
        }

        //temporarily disables scrolling by setting the overflow of the page to hidden
        Style docStyle = Document.get().getDocumentElement().getStyle();
        viewportOverflow = docStyle.getOverflow();
        docStyle.setProperty("overflow", "hidden");

        if (backgroundSize == null) {
            backgroundSize = body().width() + 300 + "px";
        }

        setupTransition();
        if (animated) {
            focusElement.getStyle().setProperty("boxShadow", "0px 0px 0px 0rem " + computedBackgroundColor);

            //the animation will take place after the boxshadow is set by the deferred command
            Scheduler.get().scheduleDeferred(() -> {
                focusElement.getStyle().setProperty("boxShadow", "0px 0px 0px " + backgroundSize + " " + computedBackgroundColor);
            });
        } else {
            focusElement.getStyle().setProperty("boxShadow", "0px 0px 0px " + backgroundSize + " " + computedBackgroundColor);
        }
        
        if (circle) {
            focusElement.getStyle().setProperty("WebkitBorderRadius", "50%");
            focusElement.getStyle().setProperty("borderRadius", "50%");
            // Temporary fixed for the IOS Issue on recalculation of the border radius
            focusElement.getStyle().setProperty("webkitBorderTopLeftRadius", "49.9%");
            focusElement.getStyle().setProperty("borderTopLeftRadius", "49.9%");
        } else {
            focusElement.getStyle().clearProperty("WebkitBorderRadius");
            focusElement.getStyle().clearProperty("borderRadius");
            focusElement.getStyle().clearProperty("webkitBorderTopLeftRadius");
            focusElement.getStyle().clearProperty("borderTopLeftRadius");
        }
        setupCutOutPosition(focusElement, targetElement, cutOutPadding, circle);

        setupWindowHandlers();
        getElement().getStyle().clearDisplay();

        // verify if the component is added to the document (via UiBinder for
        // instance)
        if (getParent() == null) {
            autoAddedToDocument = true;
            RootPanel.get().add(this);
        }
        OpenEvent.fire(this, this);
    }
1312280
function showTooltipBind() {
              if(hasEnableExp && !scope.$eval(attrs[prefix+'Enable'])) {
                return;
              }

              prepareTooltip();

              if ( ttScope.popupDelay ) {
                // Do nothing if the tooltip was already scheduled to pop-up.
                // This happens if show is triggered multiple times before any hide is triggered.
                if (!popupTimeout) {
                  popupTimeout = $timeout( show, ttScope.popupDelay, false );
                  popupTimeout.then(function(reposition){reposition();});
                }
              } else {
                show()();
              }
            }
706747
public void openPopup() {
        // If the component is disabled, do nothing.
        if (!isEnabled()) {
            return;
        }
        // If the show popup menu button is not shown, do nothing.
        if (settings.getDisplayToggleTimeMenuButton() == false) {
            return;
        }
        // If this function was called programmatically, we may need to change the focus to this
        // popup.
        if (!timeTextField.hasFocus()) {
            timeTextField.requestFocusInWindow();
        }
        // Create a new time menu.
        timeMenuPanel = new TimeMenuPanel(this, settings);

        // Create a new custom popup.
        popup = new CustomPopup(timeMenuPanel, SwingUtilities.getWindowAncestor(this),
                this, settings.borderTimePopup);
        popup.setMinimumSize(new Dimension(
                this.getSize().width + 1, timeMenuPanel.getSize().height));
        // Calculate the default origin for the popup.
        int defaultX = timeTextField.getLocationOnScreen().x;
        int defaultY = timeTextField.getLocationOnScreen().y + timeTextField.getSize().height - 1;
        // Set the popup location. (Shared function.)
        DatePicker.zSetPopupLocation(popup, defaultX, defaultY, this, timeTextField, -1, 1);
        // Show the popup and request focus.
        popup.show();
        timeMenuPanel.requestListFocus();
    }
1054451
function (e) {
    var self = this;

    clearTimeout(self.closeTimeout);
    clearTimeout(self.deferCloseTimeout);

    if (e) {
      if (e.stopPropagation) {
        e.stopPropagation();
      }
      if (e.preventDefault) {
        e.preventDefault();
      }
      e.cancelBubble = true;
    }

    // Don't do anything if already open
    if (self.isOpen) {
      return;
    }

    self.isOpen = true;
    self.$el.addClass("open");

    // Notify child view
    self.dropdownContainerView.open();
  }
532017
function(event, callback, force) {
		
		var self = this,
			ok = true;
		
		self._trigger({
			type: 'close',
			event: event,
			stop: function() {
				ok = false;
			}
		});
		
		// a destroying tooltip (force == true) may not refuse to close
		if (ok || force) {
			
			// save the method custom callback and cancel any open method custom callbacks
			if (callback) self.__callbacks.close.push(callback);
			self.__callbacks.open = [];
			
			// clear open/close timeouts
			self.__timeoutsClear();
			
			var finishCallbacks = function() {
				
				// trigger any close method custom callbacks and reset them
				$.each(self.__callbacks.close, function(i,c) {
					c.call(self, self, {
						event: event,
						origin: self._$origin[0]
					});
				});
				
				self.__callbacks.close = [];
			};
			
			if (self.__state != 'closed') {
				
				var necessary = true,
					d = new Date(),
					now = d.getTime(),
					newClosingTime = now + self.__options.animationDuration[1];
				
				// the tooltip may already already be disappearing, but if a new
				// call to close() is made after the animationDuration was changed
				// to 0 (for example), we ought to actually close it sooner than
				// previously scheduled. In that case it should be noted that the
				// browser will not adapt the animation duration to the new
				// animationDuration that was set after the start of the closing
				// animation.
				// Note: the same thing could be considered at opening, but is not
				// really useful since the tooltip is actually opened immediately
				// upon a call to _open(). Since it would not make the opening
				// animation finish sooner, its sole impact would be to trigger the
				// state event and the open callbacks sooner than the actual end of
				// the opening animation, which is not great.
				if (self.__state == 'disappearing') {
					
					if (	newClosingTime > self.__closingTime
						// in case closing is actually overdue because the script
						// execution was suspended. See #679
						&&	self.__options.animationDuration[1] > 0
					) {
						necessary = false;
					}
				}
				
				if (necessary) {
					
					self.__closingTime = newClosingTime;
					
					if (self.__state != 'disappearing') {
						self.__stateSet('disappearing');
					}
					
					var finish = function() {
						
						// stop the tracker
						clearInterval(self.__tracker);
						
						// a "beforeClose" option has been asked several times but would
						// probably useless since the content element is still accessible
						// via ::content(), and because people can always use listeners
						// inside their content to track what's going on. For the sake of
						// simplicity, this has been denied. Bur for the rare people who
						// really need the option (for old browsers or for the case where
						// detaching the content is actually destructive, for file or
						// password inputs for example), this event will do the work.
						self._trigger({
							type: 'closing',
							event: event
						});
						
						// unbind listeners which are no longer needed
						
						self._$tooltip
							.off('.'+ self.__namespace +'-triggerClose')
							.removeClass('tooltipster-dying');
						
						// orientationchange, scroll and resize listeners
						$(env.window).off('.'+ self.__namespace +'-triggerClose');
						
						// scroll listeners
						self.__$originParents.each(function(i, el) {
							$(el).off('scroll.'+ self.__namespace +'-triggerClose');
						});
						// clear the array to prevent memory leaks
						self.__$originParents = null;
						
						$(env.window.document.body).off('.'+ self.__namespace +'-triggerClose');
						
						self._$origin.off('.'+ self.__namespace +'-triggerClose');
						
						self._off('dismissable');
						
						// a plugin that would like to remove the tooltip from the
						// DOM when closed should bind on this
						self.__stateSet('closed');
						
						// trigger event
						self._trigger({
							type: 'after',
							event: event
						});
						
						// call our constructor custom callback function
						if (self.__options.functionAfter) {
							self.__options.functionAfter.call(self, self, {
								event: event,
								origin: self._$origin[0]
							});
						}
						
						// call our method custom callbacks functions
						finishCallbacks();
					};
					
					if (env.hasTransitions) {
						
						self._$tooltip.css({
							'-moz-animation-duration': self.__options.animationDuration[1] + 'ms',
							'-ms-animation-duration': self.__options.animationDuration[1] + 'ms',
							'-o-animation-duration': self.__options.animationDuration[1] + 'ms',
							'-webkit-animation-duration': self.__options.animationDuration[1] + 'ms',
							'animation-duration': self.__options.animationDuration[1] + 'ms',
							'transition-duration': self.__options.animationDuration[1] + 'ms'
						});
						
						self._$tooltip
							// clear both potential open and close tasks
							.clearQueue()
							.removeClass('tooltipster-show')
							// for transitions only
							.addClass('tooltipster-dying');
						
						if (self.__options.animationDuration[1] > 0) {
							self._$tooltip.delay(self.__options.animationDuration[1]);
						}
						
						self._$tooltip.queue(finish);
					}
					else {
						
						self._$tooltip
							.stop()
							.fadeOut(self.__options.animationDuration[1], finish);
					}
				}
			}
			// if the tooltip is already closed, we still need to trigger
			// the method custom callbacks
			else {
				finishCallbacks();
			}
		}
		
		return self;
	}
1111636
function(event){
			var self = this;
			self.$instance.hide().appendTo(self.root);
			if((!event || !event.isDefaultPrevented())
				&& self.beforeOpen(event) !== false) {

				if(event){
					event.preventDefault();
				}
				var $content = self.getContent();

				if($content) {
					opened.push(self);

					toggleGlobalEvents(true);

					self.$instance.fadeIn(self.openSpeed);
					self.beforeContent(event);

					/* Set content and show */
					return $.when($content)
						.always(function($openendContent){
							if($openendContent) {
								self.setContent($openendContent);
								self.afterContent(event);
							}
						})
						.then(self.$instance.promise())
						/* Call afterOpen after fadeIn is done */
						.done(function(){ self.afterOpen(event); });
				}
			}
			self.$instance.detach();
			return $.Deferred().reject().promise();
		}
777780
function (e) {
    var self = this;
    if (self.isOpen !== true) {
      self.open(e);
    }
    else {
      self.close(e);
    }
  }
725819
function() {
        if (!this._closed) {
            this._closed = true;

            removeElement(this.el);

            this.selectivity.events.off('selectivity-selecting', this.close);

            this.triggerClose();

            this._removeScrollListeners();
        }
    }
845803
function triggerBeforeRendering(oControl){
			bLocked = true;
			try {
				var oEvent = jQuery.Event("BeforeRendering");
				// store the element on the event (aligned with jQuery syntax)
				oEvent.srcControl = oControl;
				oControl._handleEvent(oEvent);
			} finally {
				bLocked = false;
			}
		}
759427
function handleFocusToOpenEvent( event ) {

        // Stop the event from propagating to the doc.
        event.stopPropagation()

        // If it’s a focus event, add the “focused” class to the root.
        if ( event.type == 'focus' ) {
            P.$root.addClass( CLASSES.focused )
        }

        // And then finally open the picker.
        P.open()
    }
1069942
function tabView_waitForOpened() {
    // Add event listener to wait until the tabview has been opened
    var self = { opened: false };
    function checkOpened() { self.opened = true; }
    this._controller.window.addEventListener("tabviewshown", checkOpened, false);

    try {
      mozmill.utils.waitFor(function() {
        return self.opened == true;
      }, TIMEOUT, 100, "TabView is not open.");

      this._tabViewObject = this._controller.window.TabView;
      this._groupItemsObject = this._tabViewObject._window.GroupItems;
      this._tabItemsObject = this._tabViewObject._window.TabItems;
    } finally {
      this._controller.window.removeEventListener("tabviewshown", checkOpened, false);
    }
  }
372219
function whenReady(callback) {

		function onLoaded() {
			document.removeEventListener( "DOMContentLoaded", onLoaded, false );
			callback();
		}

		if ( document.readyState === 'complete' ) {
			callback();
		} else {
			document.addEventListener( "DOMContentLoaded", onLoaded, false );
		}
	}
1296292
function () {
                for (var i = this.openedPopups.length - 1; i >= 0; i--) {
                    var popup = this.openedPopups[i];
                    popup.close();
                }
            }
934283
function (popup) {
                var curZIndex = popup.getZIndex();
                var newBaseZIndex = this.currentZIndex;
                if (curZIndex === newBaseZIndex) {
                    // already top most, nothing to do in any case!
                    return;
                }
                // gets all popups supposed to be in front of this one, including this one
                var openedPopups = this.openedPopups;
                var popupsToKeepInFront = [];
                var i, l;
                for (i = openedPopups.length - 1; i >= 0; i--) {
                    var curPopup = openedPopups[i];
                    if (curPopup === popup || curPopup.conf.zIndexKeepOpenOrder) {
                        popupsToKeepInFront.unshift(curPopup);
                        if (curPopup.getZIndex() === newBaseZIndex) {
                            newBaseZIndex -= 10;
                        }
                        if (curPopup === popup) {
                            break;
                        }
                    }
                }
                if (i < 0 || newBaseZIndex + 10 === curZIndex) {
                    // either the popup is not in openedPopups (i < 0)
                    // or it is already correctly positioned (newBaseZIndex + 10 === curZIndex)
                    return;
                }
                var eventObject = {
                    name : "beforeBringingPopupsToFront",
                    popups : popupsToKeepInFront,
                    cancel : false
                };
                this.$raiseEvent(eventObject);
                if (eventObject.cancel) {
                    return;
                }
                this.currentZIndex = newBaseZIndex;
                for (i = 0, l = popupsToKeepInFront.length; i < l; i++) {
                    var curPopup = popupsToKeepInFront[i];
                    curPopup.setZIndex(this.getZIndexForPopup(curPopup));
                }
            }
1027358
function(self, e) {
			var self = this;
			var source;

			// Save last active state before modal
			self.lastFocus = self.$elem;

			if ( self.options.should_open === false || ( typeof self.options.should_open === 'function' && self.options.should_open() === false ) ) {
				return;
			}

			// CB: before_open
			self.options.before_open.call(self, e);

			switch (self.options.type) {
				case 'inline':
					self.create_basic();
					break;

				case 'ajax':
					source = self.options.source( self.$elem, self.scope.source );
					self.fetch_ajax( source );
					break;

				case 'confirm':
					self.options.is_locked = true;
					self.create_confirm();
					break;

				case 'image':
					self.create_image();
					break;

				case 'iframe':
					source = self.options.source( self.$elem, self.scope.source );
					self.create_iframe( source );
					break;

				case 'video':
					self.create_video(self.scope.source);
					break;

				case 'instagram':
					self.create_instagram();
					break;
			}

			// call events to be watched (click, tab, keyup, keydown etc.)
			self.watch_events();
		}