Helper method for setting focus on an item after a delay
161069
function () {
                if (!filterText) {
                    var filterTextSelector = $element.find('input');
                    if (filterTextSelector.length) {
                        filterText = filterTextSelector[0];
                    }
                }
                if (filterText) {
                    $timeout_(filterText.focus.bind(filterText));
                }
            }
596723
function(delay) {
              $timeout.cancel(hider_.id_);

              // do not hide if -1 is passed in.
              if(delay !== "-1") {
                // delay the hiding operation for 1.5s by default.
                if (!isDef(delay)) {
                  delay = 1.5;
                }

                hider_.id_ = $timeout(function() {
                  $popover.off('click', insideClickHandler);
                  $document.off('click', outsideClickHandler);
                  elm.off('click', buttonClickHandler);
                  $popover.isOpen = false;
                  displayer_.cancel();
                  $popover.css('display', 'none');
                  removeEventListeners();

                  // Call the close callback
                  options.onClose(scope);
                }, delay*1000);
              }
            }
943503
def _unfocus(self, event):
        """"""
        w = self.focus_get()
        if w != self and 'spinbox' not in str(w) and 'entry' not in str(w):
            self.focus_set()
137560
function(delay) {
    if (!cdb.core.util.ie || (cdb.core.util.browser.ie && cdb.core.util.browser.ie.version > 8)) {
      this.$el.css({
        'marginBottom':'-10px',
        'display': 'block',
        'visibility':'visible',
        opacity:0
      });

      this.$el
      .delay(delay)
      .animate({
        opacity: 1,
        marginBottom: 0
      },300);
    } else {
      this.$el.show();
    }
  }
548685
def focusOutEvent(self, event):
        """"""
        # Calling asynchronously the 'add_current_text' to avoid crash
        # https://groups.google.com/group/spyderlib/browse_thread/thread/2257abf530e210bd
        if not self.is_valid():
            lineedit = self.lineEdit()
            QTimer.singleShot(50, lambda: lineedit.setText(self.selected_text))

        hide_status = getattr(self.lineEdit(), 'hide_status_icon', None)
        if hide_status:
            hide_status()
        QComboBox.focusOutEvent(self, event)
1336125
def focusInEvent(self, event):
        """"""
        self.focus_changed.emit()
        self.focus_in.emit()
        self.highlight_current_cell()
        QPlainTextEdit.focusInEvent(self, event)
255646
function selectHourOnInputElement() {
				inputElement.focus();
				setTimeout(function() {
					inputElement.get(0).setSelectionRange(0, inputElement.val().indexOf(settings.separator));
				}, 1);
			}
688443
def focus_prev(self):
        """"""
        w, focuspos = self.get_focus()
        prev = self._tree.prev_position(focuspos)
        if prev is not None:
            self.set_focus(prev)
38176
function delay(ms, done) {

  // Work around IE8 bug whereby a setTimeout callback may still be called
  // after the corresponding clearTimeout is invoked.
  var timer = null;

  function finish() {
    if (timer != null) {
      timer = null;
      done(null);
    }
  }

  function cancel() {
    if (timer != null) {
      clearTimeout(timer);
      timer = null;
      done.apply(null, arguments);
    }
  }

  timer = setTimeout(finish, ms);

  return cancel;

}
470626
private void setCurrentItemShowing(int index, boolean animateCircle, boolean delayLabelAnimate,
                                       boolean announce) {
        mTimePicker.setCurrentItemShowing(index, animateCircle);

        TextView labelToAnimate;
        if (index == HOUR_INDEX) {
            int hours = mTimePicker.getHours();
            if (!mIs24HourMode) {
                hours = hours % 12;
            }
            mTimePicker.setContentDescription(mHourPickerDescription + ": " + hours);
            if (announce) {
                DateTimePickerUtils.tryAccessibilityAnnounce(mTimePicker, mSelectHours);
            }
            labelToAnimate = mHourView;
        } else {
            int minutes = mTimePicker.getMinutes();
            mTimePicker.setContentDescription(mMinutePickerDescription + ": " + minutes);
            if (announce) {
                DateTimePickerUtils.tryAccessibilityAnnounce(mTimePicker, mSelectMinutes);
            }
            labelToAnimate = mMinuteView;
        }

        mHourView.setSelected(index == HOUR_INDEX);
        mMinuteView.setSelected(index == MINUTE_INDEX);

        ObjectAnimator pulseAnimator = DateTimePickerUtils.getPulseAnimator(labelToAnimate, 0.85f, 1.1f);
        if (delayLabelAnimate) {
            pulseAnimator.setStartDelay(PULSE_ANIMATOR_DELAY);
        }
        pulseAnimator.start();
    }
484012
function (event) {
            var inputField = this.getTextInputField();
            var blurredElement = event.target;

            if (blurredElement === inputField) {
                if (inputField.nextSibling != null && inputField.value === "") {
                    this._makeInputFieldLastChild();
                }
            } else if (blurredElement.parentNode.className.indexOf("highlight") != -1) {
                this.unhighlightOption(blurredElement.parentNode);
            }
            // call TextInput onblur handler with avoidCallback set to true
            this.$TextInput._dom_onblur.call(this, event, true);

            if (this._cfg.onblur) {
                // timeout is needed to retrieve (on every browser) the activeElement
                ariaCoreTimer.addCallback({
                    fn : function () {
                        var isAncestor = ariaUtilsDom.isAncestor;
                        var focusedEl = Aria.$window.document.activeElement;

                        // if onblur is defined and window lost focus ( ==null ) or if focus is not in the widget or
                        // dropdown element
                        if (this._cfg
                                && (focusedEl == null || ((this._dropdownPopup == null || !isAncestor(focusedEl, this._dropdownPopup.domElement)) && !isAncestor(focusedEl, this._domElt)))) {
                            this.evalCallback(this._cfg.onblur);
                        }
                    },
                    scope : this,
                    delay : 100
                });
            }
        }
997299
function focus(editor) {
    setTimeout(function() {
      if (sourceMode(editor)) editor.$area.focus();
      else editor.$frame[0].contentWindow.focus();
      refreshButtons(editor);
    }, 0);
  }
768367
def focusInEvent(self, event):
        """"""
        self.focus_changed.emit()
        return super(ShellWidget, self).focusInEvent(event)
55755
function (fn, delay) {
    var timer = null;
    if (!delay || delay < 16) {
      delay = 16;
    }

    return function () {
      var _this = this;
      var args = arguments;

      if (timer === null) {
        timer = setTimeout(function () {
          fn.apply(_this, args);
          timer = null;
        }, delay);
      }
    };
  }
778833
function(){
			var ls;
			
			if (lookingForNewDocument && FuncUnit.checkForNewDocument() ) {
				
				ls = loadSuccess;
				
				loadSuccess = null;
				if (ls) {
					FuncUnit.win.focus();
					FuncUnit.win.document.documentElement.tabIndex = 0;
					
					ls();
				}
			}
			
		setTimeout(arguments.callee, 500)
	}
315034
public static void delayedStyle(Chunk c, String tag, Collection<? extends Advanced> stylers, EventHelper eventHelper) {
      delayedStyle(c, tag, stylers, eventHelper, null);
   }
448952
def focusOutEvent(self, event):
        """"""
        self.focus_changed.emit()
        return super(ControlWidget, self).focusOutEvent(event)