Needed for header widgets to prevent expand/collapse on their clicks.
12315
public void discardHeaderClick(ClickEvent event) {
        if (event == null) return;

        // Example: we use radioset on collapsible header, so stopPropagation() is needed
        // to suppress collapsible open/close behavior.
        // But preventDefault() is not needed, otherwise radios won't switch.
        // event.preventDefault(); // For example, clicked anchors will not take the browser to a new URL

        event.stopPropagation();
        makeHeaderInactive(header.getElement());
    }
1253587
function() {
			var el = this.parts.dialog;
			var dialogSize = this.getSize();
			var win = CKEDITOR.document.getWindow(),
					viewSize = win.getViewPaneSize();

			var posX = ( viewSize.width - dialogSize.width ) / 2,
				posY = ( viewSize.height - dialogSize.height ) / 2;

			// Switch to absolute position when viewport is smaller than dialog size.
			if ( !CKEDITOR.env.ie6Compat ) {
				if ( dialogSize.height + ( posY > 0 ? posY : 0 ) > viewSize.height ||
						 dialogSize.width + ( posX > 0 ? posX : 0 ) > viewSize.width )
					el.setStyle( 'position', 'absolute' );
				else
					el.setStyle( 'position', 'fixed' );
			}

			this.move( this._.moved ? this._.position.x : posX,
					this._.moved ? this._.position.y : posY );
		}
836191
def _grid_widgets(self):
        """"""
        scrollbar_column = 0 if self.__compound is tk.LEFT else 2
        self.listbox.grid(row=0, column=1, sticky="nswe")
        self.scrollbar.grid(row=0, column=scrollbar_column, sticky="ns")
226801
def toggleCollapseAfter( self ):
        
        if ( self.isCollapsed() ):
            self.uncollapse()
        else:
            self.collapse( XSplitterHandle.CollapseDirection.After )
12193
function collapse() {
    previousHeight = element.scrollHeight;
    element.style.maxHeight = '0';
    _baseTransition.applyClass( classObject.COLLAPSED );

    return this;
  }
391099
function _ensureHighlightVisible() {
    var container = $element.querySelectorAll('.ui-select-choices-content');
    var choices = container.querySelectorAll('.ui-select-choices-row');
    if (choices.length < 1) {
      throw uiSelectMinErr('choices', "Expected multiple .ui-select-choices-row but got '{0}'.", choices.length);
    }

    if (ctrl.activeIndex < 0) {
      return;
    }

    var highlighted = choices[ctrl.activeIndex];
    var posY = highlighted.offsetTop + highlighted.clientHeight - container[0].scrollTop;
    var height = container[0].offsetHeight;

    if (posY > height) {
      container[0].scrollTop += posY - height;
    } else if (posY < highlighted.clientHeight) {
      if (ctrl.isGrouped && ctrl.activeIndex === 0)
        container[0].scrollTop = 0; //To make group header visible when going all the way up
      else
        container[0].scrollTop -= highlighted.clientHeight - posY;
    }
  }
1103667
function placeDropdown(eventType) {
        // Check for simultaneous focus and click events.
        if (eventType === 'focus') {
          isFocused = true;
        }

        // Check html data attributes
        updateOptions();

        // Set Dropdown state
        activates.addClass('active');
        origin.addClass('active');

        // Constrain width
        if (curr_options.constrainWidth === true) {
          activates.css('width', origin.outerWidth());

        } else {
          activates.css('white-space', 'nowrap');
        }

        // Offscreen detection
        var windowHeight = window.innerHeight;
        var originHeight = origin.innerHeight();
        var offsetLeft = origin.offset().left;
        var offsetTop = origin.offset().top - $(window).scrollTop();
        var currAlignment = curr_options.alignment;
        var gutterSpacing = 0;
        var leftPosition = 0;

        // Below Origin
        var verticalOffset = 0;
        if (curr_options.belowOrigin === true) {
          verticalOffset = originHeight;
        }

        // Check for scrolling positioned container.
        var scrollYOffset = 0;
        var scrollXOffset = 0;
        var wrapper = origin.parent();
        if (!wrapper.is('body')) {
          if (wrapper[0].scrollHeight > wrapper[0].clientHeight) {
            scrollYOffset = wrapper[0].scrollTop;
          }
          if (wrapper[0].scrollWidth > wrapper[0].clientWidth) {
            scrollXOffset = wrapper[0].scrollLeft;
          }
        }


        if (offsetLeft + activates.innerWidth() > $(window).width()) {
          // Dropdown goes past screen on right, force right alignment
          currAlignment = 'right';

        } else if (offsetLeft - activates.innerWidth() + origin.innerWidth() < 0) {
          // Dropdown goes past screen on left, force left alignment
          currAlignment = 'left';
        }
        // Vertical bottom offscreen detection
        if (offsetTop + activates.innerHeight() > windowHeight) {
          // If going upwards still goes offscreen, just crop height of dropdown.
          if (offsetTop + originHeight - activates.innerHeight() < 0) {
            var adjustedHeight = windowHeight - offsetTop - verticalOffset;
            activates.css('max-height', adjustedHeight);
          } else {
            // Flow upwards.
            if (!verticalOffset) {
              verticalOffset += originHeight;
            }
            verticalOffset -= activates.innerHeight();
          }
        }

        // Handle edge alignment
        if (currAlignment === 'left') {
          gutterSpacing = curr_options.gutter;
          leftPosition = origin.position().left + gutterSpacing;
        }
        else if (currAlignment === 'right') {
          var offsetRight = origin.position().left + origin.outerWidth() - activates.outerWidth();
          gutterSpacing = -curr_options.gutter;
          leftPosition =  offsetRight + gutterSpacing;
        }

        // Position dropdown
        activates.css({
          position: 'absolute',
          top: origin.position().top + verticalOffset + scrollYOffset,
          left: leftPosition + scrollXOffset
        });


        // Show dropdown
        activates.stop(true, true).css('opacity', 0)
          .slideDown({
            queue: false,
            duration: curr_options.inDuration,
            easing: 'easeOutCubic',
            complete: function() {
              $(this).css('height', '');
            }
          })
          .animate( {opacity: 1}, {queue: false, duration: curr_options.inDuration, easing: 'easeOutSine'});

        // Add click close handler to document
        setTimeout(function() {
          $(document).bind('click.'+ activates.attr('id'), function (e) {
            hideDropdown();
            $(document).unbind('click.'+ activates.attr('id'));
          });
        }, 0);
      }
1277697
function(){
		var articleRect = this.article.getBoundingClientRect();

		var buttons = this.buttons;


		var positions = this.titles.map(function(header, i){
			return {
				header: header,
				rect: header.getBoundingClientRect(),
				button: buttons[i]
			};
		});
		// this simulates a header at the end of the page
		positions.push({
			rect: {
				top: articleRect.top + this.article.scrollHeight - this.article.scrollTop
			}
		});
		// loop through the actual headers and their positions
		positions.slice(0, positions.length - 1).forEach(function(position, index){

			position.button.classList.remove("completed","active");

			var curRect = position.rect;
			var curDistance = curRect.top - articleRect.top;

			var nextRect = positions[index+1].rect;
			var nextDistance = nextRect.top - articleRect.top;

			// =====[CUR=NEXT]===
			if( nextDistance >= 0 && nextDistance <= articleRect.height && curDistance >= 0 && curDistance <= articleRect.height ) {
				position.button.classList.add("active");
			}
			// =======CUR=====[=NEXT=|===]======
			// =======CUR=======NEXT=====[===|===]===
			else if( nextDistance < (articleRect.height / 2) ) {
				position.button.classList.add("completed");
			}
			// ======[=CUR=|=NEXT=]======
			// ======[=CUR=|===]=NEXT====
			// ====CUR=[===|=NEXT]=======
			// ====CUR=[===|===]=NEXT====
			else if( nextDistance >= (articleRect.height / 2) && curDistance < (articleRect.height / 2) ) {
				position.button.classList.add("active");
			}
		});
		var elementToScroll = this.outlineScrollElement;

		if(elementToScroll) {
			// find out where the midpoint is
			var distance = (this.article.scrollTop + this.article.offsetHeight / 2) / this.article.scrollHeight;
			elementToScroll.scrollTop = (elementToScroll.scrollHeight * distance) - (elementToScroll.offsetHeight / 2);
		}
	}
743693
public void setCollapsed (boolean collapse)
    {
        if (collapse) {
            _content.setVisible(false);
            _trigger.setIcon(_downIcon);

        } else {
            _content.setVisible(true);
            _trigger.setIcon(_upIcon);
        }
        SwingUtil.refresh(this);
    }
379515
void hideHelpBubbles(boolean hide) {

        setShowEditorHelp(!hide);
        CmsValueFocusHandler.getInstance().hideHelpBubbles(RootPanel.get(), hide);
        if (!hide) {
            m_hideHelpBubblesButton.setTitle(Messages.get().key(Messages.GUI_TOOLBAR_HELP_BUBBLES_SHOWN_0));
        } else {
            m_hideHelpBubblesButton.setTitle(Messages.get().key(Messages.GUI_TOOLBAR_HELP_BUBBLES_HIDDEN_0));
        }
    }
212590
function resizeWithWindow( dialog ) {
		var win = CKEDITOR.document.getWindow();
		function resizeHandler() { dialog.layout(); }
		win.on( 'resize', resizeHandler );
		dialog.on( 'hide', function() { win.removeListener( 'resize', resizeHandler ); } );
	}
533566
function() {
  $('.collapse-link').off('click').on('click', function() {
    var $BOX_PANEL = $(this).closest('.x_panel'),
      $ICON = $(this).find('i'),
      $BOX_CONTENT = $BOX_PANEL.find('.x_content');

    // fix for some div with hardcoded fix class
    if ($BOX_PANEL.attr('style')) {
      $BOX_CONTENT.slideToggle(200, function(){
        $BOX_PANEL.removeAttr('style');
      });
    } else {
      $BOX_CONTENT.slideToggle(200);
      $BOX_PANEL.css('height', 'auto');
    }

    $ICON.toggleClass('fa-chevron-up fa-chevron-down');
  });

  $('.close-link').off('click').click(function () {
    var $BOX_PANEL = $(this).closest('.x_panel');

    $BOX_PANEL.remove();
  });
}
1306921
public static void hideAndAfter(Element e, Widget widget) {
    assert e != null && widget != null;
    if ($(e).widget() != null && $(e).widget().isAttached()) {
      replaceWidget($(e).widget(), widget, false);
    } else {
      detachWidget(widget);
      hideAndAfter(e, widget.getElement());
      attachWidget(widget, getFirstParentWidget(widget));
    }
  }
1019619
function (evt,stopBubble) {
    'use strict';
    //console.log('fidjBlockMove');
    // All but scrollable element = .c4p-container-scroll-y
    //if (evt.preventDefault) evt.preventDefault() ;
    //if (evt.preventDefault && !$(evt.target).parents('.c4p-container-scroll-y')[0]) {
    //    evt.preventDefault();
    //}
    if (evt.preventDefault && !$('.c4p-container-scroll-y').has($(evt.target)).length) {
        evt.preventDefault();
    }

    if (stopBubble && evt.stopPropagation) evt.stopPropagation();
    if (stopBubble && !evt.cancelBubble) evt.cancelBubble = true;


}
873960
def set_header_visibility(self, column=False, row=False):
        
        if row:    self._widget.verticalHeader().show()
        else:      self._widget.verticalHeader().hide()

        if column: self._widget.horizontalHeader().show()
        else:      self._widget.horizontalHeader().hide()

        return self
957232
function onResize() {
    const width = window.innerWidth;
    if (width >= 1024) {
      if (!lastSize || lastSize === 'narrow') {
        lastSize = 'wide';

        const expandedState = menu.getAttribute('aria-expanded');
        if (expandedState) {
          menu.setAttribute('data-prev-expanded', expandedState);
        }

        menu.removeAttribute('aria-expanded');
        if (scrim) {
          Classlist(scrim)
            .remove('dqpl-scrim-show')
            .remove('dqpl-scrim-fade-in');
        }

        if (trigger.tabIndex === 0) {
          // since `$trigger` gets hidden (via css hook)
          // "activate" something else in the menubar
          const topBarMenuItems = getTopLevels(topBar.querySelector('[role="menubar"]'), true);
          update(topBarMenuItems);
          topBarMenuItems.forEach((item, i) => item.tabIndex = i === 0 ? 0 : -1);
        }
        menu.setAttribute('data-locked', 'true');
      }
    } else {
      if (!lastSize || lastSize === 'wide') {
        lastSize = 'narrow';
        const wasExpanded = menu.getAttribute('data-prev-expanded') === 'true';
        menu.setAttribute('aria-expanded', wasExpanded ? 'true' : 'false');
        update(getTopLevels(topBar.querySelector('ul'), true));
        menu.setAttribute('data-locked', 'false');

        if (wasExpanded === 'true' && scrim) {
          Classlist(scrim)
            .add('dqpl-scrim-show')
            .add('dqpl-scrim-fade-in');
        }
      }
    }
  }
28076
function() {
    var togglers = $('img.toggler').click(function() {
      var src = $(this).attr('src');
      var idnum = $(this).attr('id').substr(7);
      console.log($('tr.cg-' + idnum).toggle());
      if (src.substr(-9) == 'minus.png')
        $(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
      else
        $(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
    }).css('display', '');
    if (DOCUMENTATION_OPTIONS.COLLAPSE_MODINDEX) {
        togglers.click();
    }
  }