Skip to content

Commit

Permalink
perf: remove unused imports/variables
Browse files Browse the repository at this point in the history
  • Loading branch information
sibiraj-s committed Mar 11, 2018
1 parent a9262c2 commit 182152a
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpRequest } from '@angular/common/http';
import { MessageService } from './message.service';
import * as Utils from '../utils/ngx-editor.utils';
import { map, tap, last, catchError } from 'rxjs/operators';

@Injectable()
export class CommandExecutorService {
Expand All @@ -13,9 +11,8 @@ export class CommandExecutorService {
/**
*
* @param _http HTTP Client for making http requests
* @param _messageService Message service sends message to the editor
*/
constructor(private _http: HttpClient, private _messageService: MessageService) { }
constructor(private _http: HttpClient) { }

/**
* executes command from the toolbar
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, Input, Output, EventEmitter, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { HttpEvent, HttpEventType, HttpResponse } from '@angular/common/http';
import { HttpResponse } from '@angular/common/http';
import { PopoverConfig } from 'ngx-bootstrap';
import { CommandExecutorService } from '../common/services/command-executor.service';
import { MessageService } from '../common/services/message.service';
Expand Down
2 changes: 1 addition & 1 deletion src/app/ngx-editor/ngx-editor.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<app-ngx-editor-toolbar [config]="config" (execute)="executeCommand($event)"></app-ngx-editor-toolbar>

<!-- text area -->
<div class="ngx-wrapper" #ngxWrapper>
<div class="ngx-wrapper" [hidden]="codeEditorMode" #ngxWrapper>
<div class="ngx-editor-textarea" [attr.contenteditable]="config['editable']" (input)="onContentChange($event.target.innerHTML)"
[attr.translate]="config['translate']" [attr.spellcheck]="config['spellcheck']" [style.height]="config['height']" [style.minHeight]="config['minHeight']"
[style.resize]="Utils?.canResize(resizer)" (focus)="onTextAreaFocus()" (blur)="onTextAreaBlur()" #ngxTextArea></div>
Expand Down
4 changes: 0 additions & 4 deletions src/app/ngx-editor/ngx-editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ export class NgxEditorComponent implements OnInit, ControlValueAccessor {
Utils: any = Utils;
codeEditorMode = false;

private lastViewModel: any = '';
private ngxCodeMirror: any = undefined;
private onChange: (value: string) => void;
private onTouched: () => void;
Expand Down Expand Up @@ -239,7 +238,6 @@ export class NgxEditorComponent implements OnInit, ControlValueAccessor {
return;
}


/**
* toggle between codeview and editor
*/
Expand All @@ -249,7 +247,6 @@ export class NgxEditorComponent implements OnInit, ControlValueAccessor {
if (this.codeEditorMode) {

this.ngxCodeMirror = CodeMirror.fromTextArea(this.codeEditor.nativeElement, codeMirrorConfig);
this._renderer.setStyle(this.textArea.nativeElement, 'display', 'none');

/** set value of the code editor */
this.ngxCodeMirror.setValue(this.textArea.nativeElement.innerHTML);
Expand All @@ -261,7 +258,6 @@ export class NgxEditorComponent implements OnInit, ControlValueAccessor {

/** remove/ destroy code editor */
this.ngxCodeMirror.toTextArea();
this._renderer.setStyle(this.textArea.nativeElement, 'display', 'block');

/** update the model value and html content on the contenteditable */
this.refreshView(this.ngxCodeMirror.getValue());
Expand Down
2 changes: 1 addition & 1 deletion src/app/ngx-editor/ngx-grippie/ngx-grippie.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit, HostListener } from '@angular/core';
import { Component, HostListener } from '@angular/core';
import { NgxEditorComponent } from '../ngx-editor.component';

@Component({
Expand Down
1 change: 1 addition & 0 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
"use-host-property-decorator": true,
"no-input-rename": true,
"no-output-rename": true,
"no-unused-variable": true,
"use-life-cycle-interface": true,
"use-pipe-transform-interface": true,
"component-class-suffix": true,
Expand Down

0 comments on commit 182152a

Please sign in to comment.