Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 426012
Collapse All | Expand All

(-)a/bundles/org.eclipse.orion.client.editor/web/orion/editor/contentAssist.js (-3 / +29 lines)
Lines 1324-1334 Link Here
1324
			var document = this.parentNode.ownerDocument;
1324
			var document = this.parentNode.ownerDocument;
1325
			var viewportWidth = document.documentElement.clientWidth,
1325
			var viewportWidth = document.documentElement.clientWidth,
1326
			    viewportHeight =  document.documentElement.clientHeight;
1326
			    viewportHeight =  document.documentElement.clientHeight;
1327
			if (caretLocation.y + this.parentNode.offsetHeight > viewportHeight) {
1327
			    
1328
				this.parentNode.style.top = (caretLocation.y - this.parentNode.offsetHeight - this.textView.getLineHeight()) + "px"; //$NON-NLS-0$
1328
			var spaceBelow = viewportHeight - caretLocation.y;			    
1329
			if (this.parentNode.offsetHeight > spaceBelow) {
1330
				// Check if div is too large to fit above
1331
				var spaceAbove = caretLocation.y - this.textView.getLineHeight();
1332
				if (this.parentNode.offsetHeight > spaceAbove){
1333
					// Squeeze the div into the larger area
1334
					if (spaceBelow > spaceAbove) {
1335
						this.parentNode.style.maxHeight = spaceBelow + "px"; //$NON-NLS-0$
1336
					} else {
1337
						this.parentNode.style.maxHeight = spaceAbove + "px"; //$NON-NLS-0$
1338
						this.parentNode.style.top = "0"; //$NON-NLS-0$
1339
					}
1340
				} else {
1341
					// Put the div above the line
1342
					this.parentNode.style.top = (caretLocation.y - this.parentNode.offsetHeight - this.textView.getLineHeight()) + "px"; //$NON-NLS-0$
1343
					this.parentNode.style.maxHeight = spaceAbove + "px"; //$NON-NLS-0$
1344
				}
1345
			} else {
1346
				this.parentNode.style.maxHeight = spaceBelow + "px"; //$NON-NLS-0$
1329
			}
1347
			}
1348
			
1330
			if (caretLocation.x + this.parentNode.offsetWidth > viewportWidth) {
1349
			if (caretLocation.x + this.parentNode.offsetWidth > viewportWidth) {
1331
				this.parentNode.style.left = (viewportWidth - this.parentNode.offsetWidth) + "px"; //$NON-NLS-0$
1350
				var leftSide = viewportWidth - this.parentNode.offsetWidth;
1351
				if (leftSide < 0) {
1352
					leftSide = 0;
1353
				}
1354
				this.parentNode.style.left = leftSide + "px"; //$NON-NLS-0$
1355
				this.parentNode.style.maxWidth = viewportWidth - leftSide;
1356
			} else {
1357
				this.parentNode.style.maxWidth = viewportWidth + caretLocation.x + "px"; //$NON-NLS-0$
1332
			}
1358
			}
1333
		},
1359
		},
1334
		_removeCloneNode: function(){
1360
		_removeCloneNode: function(){
(-)a/bundles/org.eclipse.orion.client.editor/web/orion/editor/contentassist.css (-2 / +3 lines)
Lines 8-20 Link Here
8
	z-index:100;
8
	z-index:100;
9
	cursor: default;
9
	cursor: default;
10
	min-width: 70px;
10
	min-width: 70px;
11
	max-width: 350px;
11
	width: 350px;
12
	max-height: 170px;
12
	height: 170px;
13
	overflow: hidden;
13
	overflow: hidden;
14
	white-space: nowrap;
14
	white-space: nowrap;
15
	border-radius: 5px;
15
	border-radius: 5px;
16
	box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 10px;
16
	box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 10px;
17
	line-height: 18px;
17
	line-height: 18px;
18
	resize: both;
18
}
19
}
19
20
20
.contentassist:focus {
21
.contentassist:focus {

Return to bug 426012