Skip to content

Commit

Permalink
Merge 4c4a741 into 7602ad4
Browse files Browse the repository at this point in the history
  • Loading branch information
Aditya Bist committed Dec 11, 2019
2 parents 7602ad4 + 4c4a741 commit 2bdcf25
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/views/htmlcontent/src/css/color-theme.css
Expand Up @@ -4,10 +4,16 @@
*--------------------------------------------------------------------------------------------*/

/** Disable selection in html **/
.results.vertBox.scrollable {
.fullsize.vertBox {
user-select: none;
}

/** Add the ability to select messages using the cursor **/
.scrollable.messages {
cursor: text;
user-select: text;
}

/** Light Theme **/

.vscode-light * {
Expand Down
5 changes: 5 additions & 0 deletions src/views/htmlcontent/src/css/styles.css
Expand Up @@ -61,6 +61,11 @@
}

/* messages */

table#messageTable td.errorMessage {
color: var(--color-error);
}

table {
font-weight: inherit;
font-size: inherit;
Expand Down
22 changes: 20 additions & 2 deletions src/views/htmlcontent/src/js/components/app.component.ts
Expand Up @@ -107,7 +107,7 @@ const template = `
</tbody>
</table>
</div>
<div id="resizeHandle" [class.hidden]="!resizing" [style.top]="resizeHandleTop"></div>
<div id="resizeHandle" [class.hidden]="!resizing" [style.top.px]="resizeHandleTop"></div>
</div>
`;
// tslint:enable:max-line-length
Expand All @@ -117,7 +117,7 @@ const template = `
*/
@Component({
selector: 'my-app',
host: { '(window:keydown)': 'keyEvent($event)', '(window:gridnav)': 'keyEvent($event)' },
host: { '(window:keydown)': 'keyEvent($event)', '(window:gridnav)': 'keyEvent($event)', '(window:keyup)' : 'keyUpEvent($event)' },
template: template,
providers: [DataService, ShortcutService],
styles: [`
Expand Down Expand Up @@ -792,6 +792,24 @@ export class AppComponent implements OnInit, AfterViewChecked {
});
}

/**
* Helper to deselect messages when Ctrl + A is pressed
* inside the grid
*/
keyUpEvent(e: KeyboardEvent): void {
let eString = this.shortcuts.buildEventString(e);
this.shortcuts.getEvent(eString).then((result) => {
if (result) {
let eventName = <string> result;
if (eventName === 'event.selectAll') {
window.getSelection().empty();
rangy.getSelection().removeAllRanges();
}
e.stopImmediatePropagation();
}
});
}

/**
* Handles rendering and unrendering necessary resources in order to properly
* navigate from one grid another. Should be called any time grid navigation is performed
Expand Down
Expand Up @@ -13,7 +13,7 @@ import { IRange } from '../../../../../models/interfaces';
*/

const template = `
<ul class="contextMenu" style="position:absolute" [class.hidden]="!visible" [style.top]="position.y" [style.left]="position.x">
<ul class="contextMenu" style="position:absolute" [class.hidden]="!visible" [style.top.px]="position.y" [style.left.px]="position.x">
<li id="copy" (click)="handleContextActionClick('copySelection')" [class.disabled]="isDisabled"> {{Constants.copyLabel}}
<span style="float: right; color: lightgrey; padding-left: 10px">{{keys['event.copySelection']}}</span>
</li>
Expand Down

0 comments on commit 2bdcf25

Please sign in to comment.