bundles/org.eclipse.orion.client.ui/web/orion/webui/dropdown.js
function addScrollButtons() {
		var dropdown = this;

		if(!this._topScrollButton && !this._bottomScrollButton) { // if scroll buttons haven't been made yet
			this._topScrollButton = document.createElement("button");
			this._bottomScrollButton = document.createElement("button");
			this._topScrollButton.classList.add("menuScrollButton", "menuTopScrollButton", "core-sprite-openarrow");
			this._bottomScrollButton.classList.add("menuScrollButton", "menuBottomScrollButton", "core-sprite-openarrow");

			this._topScrollButton.addEventListener("mousedown", function(evt){ //$NON-NLS-0$
				if (this._activeScrollInterval) {
					window.clearInterval(this._activeScrollInterval);
				}
				this._activeScrollInterval = window.setInterval(scrollUp.bind(null, evt.shiftKey ? 20 : 2), 10);
			}.bind(this));
			this._topScrollButton.addEventListener("mouseup", function(){ //$NON-NLS-0$
				if (this._activeScrollInterval) {
					window.clearInterval(this._activeScrollInterval);
					this._activeScrollInterval = null;
				}
			}.bind(this));
			
			this._bottomScrollButton.addEventListener("mousedown", function(evt){ //$NON-NLS-0$
				if (this._activeScrollInterval) {
					window.clearInterval(this._activeScrollInterval);
				}
				this._activeScrollInterval = window.setInterval(scrollDown.bind(null, evt.shiftKey ? 20 : 2), 10);
			}.bind(this));
			this._bottomScrollButton.addEventListener("mouseup", function(){ //$NON-NLS-0$
				if (this._activeScrollInterval) {
					window.clearInterval(this._activeScrollInterval);
					this._activeScrollInterval = null;
				}
			}.bind(this));
		
			this._dropdownNode.parentNode.insertBefore(this._topScrollButton, this._dropdownNode);
			this._dropdownNode.parentNode.insertBefore(this._bottomScrollButton, this._dropdownNode.nextElementSibling);
			this._dropdownNode.style.overflow = "hidden";
		}
		
		updateScrollButtonVisibility.call(this);
		return true;
		
		function scrollDown(increment) {
			dropdown._dropdownNode.scrollTop+=increment;
			updateScrollButtonVisibility.call(dropdown);
		}
		
		function scrollUp(increment) {
			dropdown._dropdownNode.scrollTop-=increment;
			updateScrollButtonVisibility.call(dropdown);
		}
	}
function addScrollButtons() {
		var dropdown = this;

		if(!this._topScrollButton && !this._bottomScrollButton) { // if scroll buttons haven't been made yet
			this._topScrollButton = document.createElement("button");
			this._bottomScrollButton = document.createElement("button");
			this._topScrollButton.classList.add("menuScrollButton", "menuTopScrollButton", "core-sprite-openarrow");
			this._bottomScrollButton.classList.add("menuScrollButton", "menuBottomScrollButton", "core-sprite-openarrow");

			this._topScrollButton.addEventListener("mousedown", function(evt){ //$NON-NLS-0$
				if (this._activeScrollInterval) {
					window.clearInterval(this._activeScrollInterval);
				}
				this._activeScrollInterval = window.setInterval(scrollUp.bind(null, evt.shiftKey ? 20 : 2), 10);
			}.bind(this));
			this._topScrollButton.addEventListener("mouseup", function(){ //$NON-NLS-0$
				if (this._activeScrollInterval) {
					window.clearInterval(this._activeScrollInterval);
					this._activeScrollInterval = null;
				}
			}.bind(this));
			
			this._bottomScrollButton.addEventListener("mousedown", function(evt){ //$NON-NLS-0$
				if (this._activeScrollInterval) {
					window.clearInterval(this._activeScrollInterval);
				}
				this._activeScrollInterval = window.setInterval(scrollDown.bind(null, evt.shiftKey ? 20 : 2), 10);
			}.bind(this));
			this._bottomScrollButton.addEventListener("mouseup", function(){ //$NON-NLS-0$
				if (this._activeScrollInterval) {
					window.clearInterval(this._activeScrollInterval);
					this._activeScrollInterval = null;
				}
			}.bind(this));
		
			this._dropdownNode.parentNode.insertBefore(this._topScrollButton, this._dropdownNode);
			this._dropdownNode.parentNode.insertBefore(this._bottomScrollButton, this._dropdownNode.nextElementSibling);
			this._dropdownNode.style.overflow = "hidden";
		}
		
		updateScrollButtonVisibility.call(this);
		return true;
		
		function scrollDown(increment) {
			dropdown._dropdownNode.scrollTop+=increment;
			updateScrollButtonVisibility.call(dropdown);
		}
		
		function scrollUp(increment) {
			dropdown._dropdownNode.scrollTop-=increment;
			updateScrollButtonVisibility.call(dropdown);
		}
	}
function addScrollButtons ( ) { var dropdown = this ; if ( ! this . _topScrollButton && ! this . _bottomScrollButton ) { // if scroll buttons haven't been made yet this . _topScrollButton = document . createElement ( "button" ) ; this . _bottomScrollButton = document . createElement ( "button" ) ; this . _topScrollButton . classList . add ( "menuScrollButton" , "menuTopScrollButton" , "core-sprite-openarrow" ) ; this . _bottomScrollButton . classList . add ( "menuScrollButton" , "menuBottomScrollButton" , "core-sprite-openarrow" ) ; this . _topScrollButton . addEventListener ( "mousedown" , function ( evt ) { //$NON-NLS-0$ if ( this . _activeScrollInterval ) { window . clearInterval ( this . _activeScrollInterval ) ; } this . _activeScrollInterval = window . setInterval ( scrollUp . bind ( null , evt . shiftKey ? 20 : 2 ) , 10 ) ; } . bind ( this ) ) ; this . _topScrollButton . addEventListener ( "mouseup" , function ( ) { //$NON-NLS-0$ if ( this . _activeScrollInterval ) { window . clearInterval ( this . _activeScrollInterval ) ; this . _activeScrollInterval = null ; } } . bind ( this ) ) ; this . _bottomScrollButton . addEventListener ( "mousedown" , function ( evt ) { //$NON-NLS-0$ if ( this . _activeScrollInterval ) { window . clearInterval ( this . _activeScrollInterval ) ; } this . _activeScrollInterval = window . setInterval ( scrollDown . bind ( null , evt . shiftKey ? 20 : 2 ) , 10 ) ; } . bind ( this ) ) ; this . _bottomScrollButton . addEventListener ( "mouseup" , function ( ) { //$NON-NLS-0$ if ( this . _activeScrollInterval ) { window . clearInterval ( this . _activeScrollInterval ) ; this . _activeScrollInterval = null ; } } . bind ( this ) ) ; this . _dropdownNode . parentNode . insertBefore ( this . _topScrollButton , this . _dropdownNode ) ; this . _dropdownNode . parentNode . insertBefore ( this . _bottomScrollButton , this . _dropdownNode . nextElementSibling ) ; this . _dropdownNode . style . overflow = "hidden" ; } updateScrollButtonVisibility . call ( this ) ; return true ; function scrollDown ( increment ) { dropdown . _dropdownNode . scrollTop += increment ; updateScrollButtonVisibility . call ( dropdown ) ; } function scrollUp ( increment ) { dropdown . _dropdownNode . scrollTop -= increment ; updateScrollButtonVisibility . call ( dropdown ) ; } }
Adds scrolling feature to a list
Adds scrolling feature to a list