Override this to provide extra space on right for close button
768290
@Override
    protected int calculateTabWidth(final int tabPlacement, final int tabIndex, final FontMetrics metrics) {
        if (_pane.getSeparators().contains(tabIndex)) {
            return SEPARATOR_WIDTH;
        }
        int width = super.calculateTabWidth(tabPlacement, tabIndex, metrics);
        if (!_pane.getUnclosables().contains(tabIndex)) {
            width += CLOSE_ICON_WIDTH;
        }
        return width;
    }
43273
def save_and_close_enable(self, top_left, bottom_right):
        """"""
        self.btn_save_and_close.setEnabled(True)
        self.btn_save_and_close.setAutoDefault(True)
        self.btn_save_and_close.setDefault(True)
990974
public void setUseMinWidth(boolean useMinWidth) {

        if (useMinWidth != m_useMinWidth) {
            if (useMinWidth) {
                addStyleName(I_CmsLayoutBundle.INSTANCE.buttonCss().cmsMinWidth());
            } else {
                removeStyleName(I_CmsLayoutBundle.INSTANCE.buttonCss().cmsMinWidth());
            }
            m_useMinWidth = useMinWidth;
        }
    }
953176
def _pad(self):
    
    if self._indent:
      self.whitespace(self._indent * len(self._open_elements))
159156
def right_margin(self, margin):
        '''
        '''
        if margin >=1 and margin <=255:
            self.send(chr(27)+'Q'+chr(margin))
        else:
            raise RuntimeError('Invalid margin parameter in function rightMargin')
504357
function () {
            var t = this,
                prefix = t.o.prefix;

            if (t.isTextarea) {
                t.$box.after(
                    t.$ta
                        .css({height: ''})
                        .val(t.html())
                        .removeClass(prefix + 'textarea')
                        .show()
                );
            } else {
                t.$box.after(
                    t.$ed
                        .css({height: ''})
                        .removeClass(prefix + 'editor')
                        .removeAttr('contenteditable')
                        .removeAttr('dir')
                        .html(t.html())
                        .show()
                );
            }

            t.$ed.off('dblclick', 'img');

            t.destroyPlugins();

            t.$box.remove();
            t.$c.removeData('trumbowyg');
            $('body').removeClass(prefix + 'body-fullscreen');
            t.$c.trigger('tbwclose');
            $(window).off('scroll.' + t.eventNamespace + ' resize.' + t.eventNamespace);
        }
1366397
function updateResizeLimits() {
        var editorAreaHeight = $editorHolder.height();

        $editorHolder.siblings().each(function (i, elem) {
            var $elem = $(elem);
            if ($elem.css("display") === "none") {
                $elem.data("maxsize", editorAreaHeight);
            } else {
                $elem.data("maxsize", editorAreaHeight + $elem.outerHeight());
            }
        });
    }
1306507
def drop_space(self):
        ''''''
        cur = self._conn.cursor()
        cur.executescript(DROP_SQL_MODEL)
        self._conn.commit()
        cur.close()
        return
567925
function (leftFlushPt, rightFlushPt) {
		//if we can't fit the popup left or right of the activator then forget vertical positioning
		if (!this.initHorizontalPositioning()) {
			return false;
		}

		var clientRect = this.getBoundingRect(this.node);
		var innerHeight = this.getViewHeight();

		//adjust vertical positioning (high or low nub & popup position)
		if (this.floating){
			if (this.activatorOffset.top < (innerHeight/2)){
				this.applyPosition({top: this.activatorOffset.top + this.activatorOffset.height/2});
				this.addRemoveClass('high', true);
			} else {
				this.applyPosition({top:this.activatorOffset.top + this.activatorOffset.height/2 - clientRect.height});
				this.addRemoveClass('low', true);
			}
		} else {
			if (((clientRect.top + clientRect.height) > innerHeight) && ((innerHeight - clientRect.bottom) < (clientRect.top - clientRect.height))) {
				this.applyPosition({top: clientRect.top - clientRect.height - this.activatorOffset.top - this.activatorOffset.height/2});
				this.addRemoveClass('low', true);
			} else {
				this.applyPosition({top: this.activatorOffset.height/2});
				this.addRemoveClass('high', true);
			}
		}

		//If the activator's right side is within our left side cut off use flush positioning
		if ((this.activatorOffset.left + this.activatorOffset.width) < leftFlushPt){
			this.addClass('left');
			this.addClass('corner');
			return true;
		}
		//If the activator's left side is within our right side cut off use flush positioning
		else if (this.activatorOffset.left > rightFlushPt) {
			this.addClass('right');
			this.addClass('corner');
			return true;
		}

		return false;
	}
1124809
function _keyRight() {
            if (lxSelect.choicesViewMode !== 'panes' || lxSelect.activeChoiceIndex === -1) {
                return;
            }

            var paneOpened = _openPane((lxSelect.panes.length - 1), lxSelect.activeChoiceIndex, true);

            if (paneOpened) {
                lxSelect.activeChoiceIndex = 0;
            } else {
                _keySelect();
            }
        }
683097
def extend_left_to(self, window, max_size):
        """"""
        rofs = self.ofs - window.ofs_end()
        nsize = rofs + self.size
        rofs -= nsize - min(nsize, max_size)
        self.ofs = self.ofs - rofs
        self.size += rofs
764874
private void adaptWidth() {
        adapter.setWidth(width);

        if (rootView != null) {
            rootView.setWidth(width);
            rootView.requestLayout();
        }
    }
130683
function(showTabMenu) {
		if( this.tabs.length === 0 ) {
			return;
		}

		//Show the menu based on function argument
		this.tabDropdownButton.element.toggle(showTabMenu === true);

		var size = function( val ) {
			return val ? 'width' : 'height';
		};
		this.element.css( size( !this.parent._sided ), '' );
		this.element[ size( this.parent._sided ) ]( this.layoutManager.config.dimensions.headerHeight );
		var availableWidth = this.element.outerWidth() - this.controlsContainer.outerWidth() - this._tabControlOffset,
			cumulativeTabWidth = 0,
			visibleTabWidth = 0,
			tabElement,
			i,
			j,
			marginLeft,
			overlap = 0,
			tabWidth,
			tabOverlapAllowance = this.layoutManager.config.settings.tabOverlapAllowance,
			tabOverlapAllowanceExceeded = false,
			activeIndex = (this.activeContentItem ? this.tabs.indexOf(this.activeContentItem.tab) : 0),
			activeTab = this.tabs[activeIndex];
		if( this.parent._sided )
			availableWidth = this.element.outerHeight() - this.controlsContainer.outerHeight() - this._tabControlOffset;
		this._lastVisibleTabIndex = -1;

		for( i = 0; i < this.tabs.length; i++ ) {
			tabElement = this.tabs[ i ].element;

			//Put the tab in the tabContainer so its true width can be checked
			this.tabsContainer.append( tabElement );
			tabWidth = tabElement.outerWidth() + parseInt( tabElement.css( 'margin-right' ), 10 );

			cumulativeTabWidth += tabWidth;

			//Include the active tab's width if it isn't already
			//This is to ensure there is room to show the active tab
			if (activeIndex <= i) {
				visibleTabWidth = cumulativeTabWidth;
			} else {
				visibleTabWidth = cumulativeTabWidth + activeTab.element.outerWidth() + parseInt(activeTab.element.css('margin-right'), 10);
			}

			// If the tabs won't fit, check the overlap allowance.
			if( visibleTabWidth > availableWidth ) {

				//Once allowance is exceeded, all remaining tabs go to menu.
				if (!tabOverlapAllowanceExceeded) {

					//No overlap for first tab or active tab
					//Overlap spreads among non-active, non-first tabs
					if (activeIndex > 0 && activeIndex <= i) {
						overlap = ( visibleTabWidth - availableWidth ) / (i - 1);
					} else {
						overlap = ( visibleTabWidth - availableWidth ) / i;
					}

					//Check overlap against allowance.
					if (overlap < tabOverlapAllowance) {
						for ( j = 0; j <= i; j++ ) {
							marginLeft = (j !== activeIndex && j !== 0) ? '-' + overlap + 'px' : '';
							this.tabs[j].element.css({'z-index': i - j, 'margin-left': marginLeft});
						}
						this._lastVisibleTabIndex = i;
						this.tabsContainer.append(tabElement);
					} else {
						tabOverlapAllowanceExceeded = true;
					}

				} else if (i === activeIndex) {
					//Active tab should show even if allowance exceeded. (We left room.)
					tabElement.css({'z-index': 'auto', 'margin-left': ''});
					this.tabsContainer.append(tabElement);
				}

				if (tabOverlapAllowanceExceeded && i !== activeIndex) {
					if (showTabMenu) {
						//Tab menu already shown, so we just add to it.
						tabElement.css({'z-index': 'auto', 'margin-left': ''});
						this.tabDropdownContainer.append(tabElement);
					} else {
						//We now know the tab menu must be shown, so we have to recalculate everything.
						this._updateTabSizes(true);
						return;
					}
				}

			}
			else {
				this._lastVisibleTabIndex = i;
				tabElement.css({'z-index': 'auto', 'margin-left': ''});
				this.tabsContainer.append( tabElement );
			}
		}

	}
431412
function CustomSidebarFactory(CloseButton) {
  const SideBar = SidebarFactory(CloseButton);
  const CustomSidebar = (props) => (
    <StyledSideBarContainer>
      <SideBar {...props}/>
    </StyledSideBarContainer>
  );
  return CustomSidebar;
}
412350
function ( nButton, oConfig )
	{
		var
			that = this,
			oPos = $(nButton).offset(),
			nHidden = oConfig._collection,
			iDivX = oPos.left,
			iDivY = oPos.top + $(nButton).outerHeight(),
			iWinHeight = $(window).height(), iDocHeight = $(document).height(),
			iWinWidth = $(window).width(), iDocWidth = $(document).width();

		nHidden.style.position = "absolute";
		nHidden.style.left = iDivX+"px";
		nHidden.style.top = iDivY+"px";
		nHidden.style.display = "block";
		$(nHidden).css('opacity',0);

		var nBackground = document.createElement('div');
		nBackground.style.position = "absolute";
		nBackground.style.left = "0px";
		nBackground.style.top = "0px";
		nBackground.style.height = ((iWinHeight>iDocHeight)? iWinHeight : iDocHeight) +"px";
		nBackground.style.width = ((iWinWidth>iDocWidth)? iWinWidth : iDocWidth) +"px";
		nBackground.className = this.classes.collection.background;
		$(nBackground).css('opacity',0);

		document.body.appendChild( nBackground );
		document.body.appendChild( nHidden );

		/* Visual corrections to try and keep the collection visible */
		var iDivWidth = $(nHidden).outerWidth();
		var iDivHeight = $(nHidden).outerHeight();

		if ( iDivX + iDivWidth > iDocWidth )
		{
			nHidden.style.left = (iDocWidth-iDivWidth)+"px";
		}

		if ( iDivY + iDivHeight > iDocHeight )
		{
			nHidden.style.top = (iDivY-iDivHeight-$(nButton).outerHeight())+"px";
		}

		this.dom.collection.collection = nHidden;
		this.dom.collection.background = nBackground;

		/* This results in a very small delay for the end user but it allows the animation to be
		 * much smoother. If you don't want the animation, then the setTimeout can be removed
		 */
		setTimeout( function () {
			$(nHidden).animate({"opacity": 1}, 500);
			$(nBackground).animate({"opacity": 0.25}, 500);
		}, 10 );

		/* Resize the buttons to the Flash contents fit */
		this.fnResizeButtons();

		/* Event handler to remove the collection display */
		$(nBackground).click( function () {
			that._fnCollectionHide.call( that, null, null );
		} );
	}
1181842
function () {
		var titleOffset = 0,
			title = this.title,
			subtitle = this.subtitle,
			options = this.options,
			titleOptions = options.title,
			subtitleOptions = options.subtitle,
			autoWidth = this.spacingBox.width - 44; // 44 makes room for default context button

		if (title) {
			title
				.css({ width: (titleOptions.width || autoWidth) + PX })
				.align(extend({ y: 15 }, titleOptions), false, 'spacingBox');
			
			if (!titleOptions.floating && !titleOptions.verticalAlign) {
				titleOffset = title.getBBox().height;

				// Adjust for browser consistency + backwards compat after #776 fix
				if (titleOffset >= 18 && titleOffset <= 25) {
					titleOffset = 15; 
				}
			}
		}
		if (subtitle) {
			subtitle
				.css({ width: (subtitleOptions.width || autoWidth) + PX })
				.align(extend({ y: titleOffset + titleOptions.margin }, subtitleOptions), false, 'spacingBox');
			
			if (!subtitleOptions.floating && !subtitleOptions.verticalAlign) {
				titleOffset = mathCeil(titleOffset + subtitle.getBBox().height);
			}
		}

		this.titleOffset = titleOffset; // used in getMargins
	}
557785
function () {
                var cfg = this._cfg, state = cfg.stateObject;
                if (!cfg.fullWidth && cfg.width > -1) {
                    var w = cfg.width - state.marginLeft - state.marginRight;
                    if (this._hasBorder(state.skipLeftBorder, cfg.iconsLeft)) {
                        // remove the size of the left border if there is one:
                        w -= state.spcLeft;
                    }
                    if (this._hasBorder(state.skipRightBorder, cfg.iconsRight)) {
                        // remove the size of the right border if there is one:
                        w -= (state.sprWidth - state.spcLeft);
                    }
                    this.innerWidth = w > 0 ? w : 0;
                } else {
                    this.innerWidth = -1;
                }

                if (state.verticalAlign && state.innerHeight) {
                    this.innerHeight = ariaUtilsType.isNumber(state.innerHeight) ? state.innerHeight : -1;
                } else {
                    this.innerHeight = state.sprHeight - state.marginTop - state.marginBottom;
                }
            }