4
4
* ------------------------------------------------------------------------------------------ */
5
5
6
6
import { Component , OnInit , Inject , forwardRef , ViewChild , ViewChildren , QueryList , ElementRef ,
7
- EventEmitter , ChangeDetectorRef , AfterViewChecked } from '@angular/core' ;
7
+ EventEmitter , AfterViewChecked } from '@angular/core' ;
8
8
import { IObservableCollection , SlickGrid , VirtualizedCollection } from 'angular2-slickgrid' ;
9
9
import { ISlickRange , FieldType , IColumnDefinition , IGridDataRow ,
10
10
IGridIcon , IMessage , IRange , ISelectionData , DbCellValue } from '../../../../../models/interfaces' ;
@@ -153,19 +153,18 @@ export class AppComponent implements OnInit, AfterViewChecked {
153
153
private scrollTimeOutTime = 200 ;
154
154
private windowSize = 50 ;
155
155
private maxScrollGrids = 8 ;
156
- private selectionModel = 'DragRowSelectionModel' ;
157
- private slickgridPlugins = [ 'AutoColumnSize' ] ;
156
+ public selectionModel = 'DragRowSelectionModel' ;
157
+ public slickgridPlugins = [ 'AutoColumnSize' ] ;
158
158
private _rowHeight = 29 ;
159
159
private _resultsPaneBoundary = 22 ;
160
160
private _defaultNumShowingRows = 8 ;
161
- private Constants = Constants ;
162
- private Utils = Utils ;
163
- private _messagesPaneHeight : number ;
161
+ public Constants = Constants ;
162
+ public Utils = Utils ;
164
163
165
164
// the function implementations of keyboard available events
166
165
private shortcutfunc = {
167
166
'event.focusResultsGrid' : ( ) => {
168
- this . slickgrids . toArray ( ) [ this . activeGrid ] . _grid . setActiveCell ( 0 , 1 ) ;
167
+ this . slickgrids . toArray ( ) [ this . activeGrid ] [ ' _grid' ] . setActiveCell ( 0 , 1 ) ;
169
168
} ,
170
169
'event.toggleResultPane' : ( ) => {
171
170
this . resultActive = ! this . resultActive ;
@@ -276,7 +275,7 @@ export class AppComponent implements OnInit, AfterViewChecked {
276
275
}
277
276
] ;
278
277
279
- private startString = new Date ( ) . toLocaleTimeString ( ) ;
278
+ public startString = new Date ( ) . toLocaleTimeString ( ) ;
280
279
private config ;
281
280
282
281
// FIELDS
@@ -289,21 +288,21 @@ export class AppComponent implements OnInit, AfterViewChecked {
289
288
private messages : IMessage [ ] = [ ] ;
290
289
private scrollTimeOut : NodeJS . Timeout ;
291
290
private messagesAdded = false ;
292
- private resizing = false ;
293
- private resizeHandleTop = 0 ;
294
- private scrollEnabled = true ;
291
+ public resizing = false ;
292
+ public resizeHandleTop = 0 ;
293
+ public scrollEnabled = true ;
295
294
private resultActive = true ;
296
295
private _messageActive = true ;
297
296
private firstRender = true ;
298
- private resultsScrollTop = 0 ;
297
+ public resultsScrollTop = 0 ;
299
298
private activeGrid = 0 ;
300
- private messageShortcut ;
301
- private resultShortcut ;
302
- private totalElapsedTimeSpan : number ;
303
- private complete = false ;
299
+ public messageShortcut ;
300
+ public resultShortcut ;
301
+ public totalElapsedTimeSpan : number ;
302
+ public complete = false ;
304
303
private uri : string ;
305
304
private hasRunQuery : boolean = false ;
306
- private resultsFontSize ;
305
+ public resultsFontSize ;
307
306
@ViewChild ( 'contextmenu' ) contextMenu : ContextMenu ;
308
307
@ViewChild ( 'messagescontextmenu' ) messagesContextMenu : MessagesContextMenu ;
309
308
@ViewChildren ( 'slickgrid' ) slickgrids : QueryList < SlickGrid > ;
@@ -321,8 +320,7 @@ export class AppComponent implements OnInit, AfterViewChecked {
321
320
322
321
constructor ( @Inject ( forwardRef ( ( ) => DataService ) ) public dataService : DataService ,
323
322
@Inject ( forwardRef ( ( ) => ShortcutService ) ) private shortcuts : ShortcutService ,
324
- @Inject ( forwardRef ( ( ) => ElementRef ) ) private _el : ElementRef ,
325
- @Inject ( forwardRef ( ( ) => ChangeDetectorRef ) ) private cd : ChangeDetectorRef ) { }
323
+ @Inject ( forwardRef ( ( ) => ElementRef ) ) private _el : ElementRef ) { }
326
324
327
325
/**
328
326
* Called by Angular when the component is initialized
@@ -469,7 +467,7 @@ export class AppComponent implements OnInit, AfterViewChecked {
469
467
* Toggle the messages pane
470
468
*/
471
469
private toggleMessagesPane ( ) : void {
472
- this . messageActive = ! this . messageActive
470
+ this . messageActive = ! this . messageActive ;
473
471
if ( this . messageActive ) {
474
472
this . resizeResults ( ) ;
475
473
}
@@ -501,7 +499,7 @@ export class AppComponent implements OnInit, AfterViewChecked {
501
499
/**
502
500
* Handles toggling messages via key event
503
501
*/
504
- private handleMessagesKeydown ( event : KeyboardEvent ) : void {
502
+ public handleMessagesKeydown ( event : KeyboardEvent ) : void {
505
503
if ( this . handleKeydown ( event ) ) {
506
504
this . toggleMessagesPane ( ) ;
507
505
}
@@ -510,7 +508,7 @@ export class AppComponent implements OnInit, AfterViewChecked {
510
508
/**
511
509
* Handles toggling messages via key event
512
510
*/
513
- private handleResultsKeydown ( event : KeyboardEvent ) : void {
511
+ public handleResultsKeydown ( event : KeyboardEvent ) : void {
514
512
if ( this . handleKeydown ( event ) ) {
515
513
this . toggleResultsPane ( ) ;
516
514
}
@@ -793,22 +791,20 @@ export class AppComponent implements OnInit, AfterViewChecked {
793
791
* Sets up the resize for the messages/results panes bar
794
792
*/
795
793
setupResizeBind ( ) : void {
796
- const self = this ;
797
- let $resizeHandle = $ ( self . _el . nativeElement . querySelector ( '#messageResizeHandle' ) ) ;
798
- let $messagePane = $ ( self . _el . nativeElement . querySelector ( '#messages' ) ) ;
794
+ let $resizeHandle = $ ( this . _el . nativeElement . querySelector ( '#messageResizeHandle' ) ) ;
795
+ let $messagePane = $ ( this . _el . nativeElement . querySelector ( '#messages' ) ) ;
799
796
$resizeHandle . bind ( 'dragstart' , ( e ) => {
800
- self . resizing = true ;
801
- self . resizeHandleTop = e . pageY ;
802
- this . _messagesPaneHeight = $ ( '#messages' ) . get ( 0 ) . clientHeight ;
797
+ this . resizing = true ;
798
+ this . resizeHandleTop = e . pageY ;
803
799
return true ;
804
800
} ) ;
805
801
806
802
$resizeHandle . bind ( 'drag' , ( e ) => {
807
- self . resizeHandleTop = e . pageY ;
803
+ this . resizeHandleTop = e . pageY ;
808
804
} ) ;
809
805
810
806
$resizeHandle . bind ( 'dragend' , ( e ) => {
811
- self . resizing = false ;
807
+ this . resizing = false ;
812
808
// redefine the min size for the messages based on the final position
813
809
$messagePane . css ( 'min-height' , $ ( window ) . height ( ) - ( e . pageY + 22 ) ) ;
814
810
this . resizeResults ( ) ;
0 commit comments