Skip to content

Commit

Permalink
chore: use more specific function names
Browse files Browse the repository at this point in the history
  • Loading branch information
sibiraj-s committed Mar 11, 2018
1 parent 8e3e65b commit b93fc9d
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 52 deletions.
98 changes: 49 additions & 49 deletions docs/components/NgxEditorComponent.html
Original file line number Diff line number Diff line change
Expand Up @@ -516,17 +516,17 @@ <h6><b>Methods</b></h6>
<li>
<a href="#monitorEditor">monitorEditor</a>
</li>
<li>
<a href="#onBlur">onBlur</a>
</li>
<li>
<a href="#onContentChange">onContentChange</a>
</li>
<li>
<a href="#onEditorFocus">onEditorFocus</a>
</li>
<li>
<a href="#onFocus">onFocus</a>
<a href="#onTextAreaBlur">onTextAreaBlur</a>
</li>
<li>
<a href="#onTextAreaFocus">onTextAreaFocus</a>
</li>
<li>
<a href="#refreshView">refreshView</a>
Expand Down Expand Up @@ -1344,43 +1344,6 @@ <h3 id="methods">
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="onBlur"></a>
<span class="name">
<b>
onBlur
</b>
<a href="#onBlur"><span class="fa fa-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>onBlur()</code>
</td>
</tr>


<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="143" class="link-to-prism">src/app/ngx-editor/ngx-editor.component.ts:143</a></div>
</td>
</tr>

<tr>
<td class="col-md-4">

<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>

</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
Expand Down Expand Up @@ -1500,18 +1463,55 @@ <h3 id="methods">
<tbody>
<tr>
<td class="col-md-4">
<a name="onFocus"></a>
<a name="onTextAreaBlur"></a>
<span class="name">
<b>
onTextAreaBlur
</b>
<a href="#onTextAreaBlur"><span class="fa fa-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>onTextAreaBlur()</code>
</td>
</tr>


<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="143" class="link-to-prism">src/app/ngx-editor/ngx-editor.component.ts:143</a></div>
</td>
</tr>

<tr>
<td class="col-md-4">

<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>

</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="onTextAreaFocus"></a>
<span class="name">
<b>
onFocus
onTextAreaFocus
</b>
<a href="#onFocus"><span class="fa fa-link"></span></a>
<a href="#onTextAreaFocus"><span class="fa fa-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>onFocus()</code>
<code>onTextAreaFocus()</code>
</td>
</tr>

Expand Down Expand Up @@ -2271,7 +2271,7 @@ <h3 id="inputs">
/**
* events
*/
onFocus(): void {
onTextAreaFocus(): void {
this.enableToolbar &#x3D; true;
this.focus.emit(&#x27;focus&#x27;);
return;
Expand Down Expand Up @@ -2300,7 +2300,7 @@ <h3 id="inputs">
return;
}

onBlur(): void {
onTextAreaBlur(): void {

/** save selection if focussed out */
this._commandExecutor.savedSelection &#x3D; Utils.saveSelection();
Expand Down Expand Up @@ -2489,7 +2489,7 @@ <h3 id="inputs">
&lt;div class&#x3D;&quot;ngx-wrapper&quot; #ngxWrapper&gt;
&lt;div class&#x3D;&quot;ngx-editor-textarea&quot; [attr.contenteditable]&#x3D;&quot;config[&#x27;editable&#x27;]&quot; (input)&#x3D;&quot;onContentChange($event.target.innerHTML)&quot;
[attr.translate]&#x3D;&quot;config[&#x27;translate&#x27;]&quot; [attr.spellcheck]&#x3D;&quot;config[&#x27;spellcheck&#x27;]&quot; [style.height]&#x3D;&quot;config[&#x27;height&#x27;]&quot; [style.minHeight]&#x3D;&quot;config[&#x27;minHeight&#x27;]&quot;
[style.resize]&#x3D;&quot;Utils?.canResize(resizer)&quot; (focus)&#x3D;&quot;onFocus()&quot; (blur)&#x3D;&quot;onBlur()&quot; #ngxTextArea&gt;&lt;/div&gt;
[style.resize]&#x3D;&quot;Utils?.canResize(resizer)&quot; (focus)&#x3D;&quot;onTextAreaFocus()&quot; (blur)&#x3D;&quot;onTextAreaBlur()&quot; #ngxTextArea&gt;&lt;/div&gt;

&lt;span class&#x3D;&quot;ngx-editor-placeholder&quot;&gt;{{ placeholder || config[&#x27;placeholder&#x27;] }}&lt;/span&gt;
&lt;/div&gt;
Expand Down Expand Up @@ -2526,7 +2526,7 @@ <h3 id="inputs">
<script src="../js/libs/htmlparser.js"></script>
<script src="../js/libs/deep-iterator.js"></script>
<script>
var COMPONENT_TEMPLATE = '<div><div class="ngx-editor" id="ngxEditor" [style.width]="config[\'width\']" [style.minWidth]="config[\'minWidth\']" tabindex="0" (focus)="onEditorFocus()"> <app-ngx-editor-toolbar [config]="config" (execute)="executeCommand($event)"></app-ngx-editor-toolbar> <!-- text area --> <div class="ngx-wrapper" #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)="onFocus()" (blur)="onBlur()" #ngxTextArea></div> <span class="ngx-editor-placeholder">{{ placeholder || config[\'placeholder\'] }}</span> </div> <textarea #ngxCodeEditor [hidden]="true"></textarea> <app-ngx-editor-message></app-ngx-editor-message> <app-ngx-grippie *ngIf="resizer === \'stack\'"></app-ngx-grippie></div></div>'
var COMPONENT_TEMPLATE = '<div><div class="ngx-editor" id="ngxEditor" [style.width]="config[\'width\']" [style.minWidth]="config[\'minWidth\']" tabindex="0" (focus)="onEditorFocus()"> <app-ngx-editor-toolbar [config]="config" (execute)="executeCommand($event)"></app-ngx-editor-toolbar> <!-- text area --> <div class="ngx-wrapper" #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> <span class="ngx-editor-placeholder">{{ placeholder || config[\'placeholder\'] }}</span> </div> <textarea #ngxCodeEditor [hidden]="true"></textarea> <app-ngx-editor-message></app-ngx-editor-message> <app-ngx-grippie *ngIf="resizer === \'stack\'"></app-ngx-grippie></div></div>'
var COMPONENTS = [{'name': 'NgxEditorComponent', 'selector': 'app-ngx-editor'},{'name': 'NgxEditorMessageComponent', 'selector': 'app-ngx-editor-message'},{'name': 'NgxEditorToolbarComponent', 'selector': 'app-ngx-editor-toolbar'},{'name': 'NgxGrippieComponent', 'selector': 'app-ngx-grippie'}];
var DIRECTIVES = [];
var ACTUAL_COMPONENT = {'name': 'NgxEditorComponent'};
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 @@ -7,7 +7,7 @@
<div class="ngx-wrapper" #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)="onFocus()" (blur)="onBlur()" #ngxTextArea></div>
[style.resize]="Utils?.canResize(resizer)" (focus)="onTextAreaFocus()" (blur)="onTextAreaBlur()" #ngxTextArea></div>

<span class="ngx-editor-placeholder">{{ placeholder || config['placeholder'] }}</span>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/app/ngx-editor/ngx-editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class NgxEditorComponent implements OnInit, ControlValueAccessor {
/**
* events
*/
onFocus(): void {
onTextAreaFocus(): void {
this.enableToolbar = true;
this.focus.emit('focus');
return;
Expand Down Expand Up @@ -140,7 +140,7 @@ export class NgxEditorComponent implements OnInit, ControlValueAccessor {
return;
}

onBlur(): void {
onTextAreaBlur(): void {

/** save selection if focussed out */
this._commandExecutor.savedSelection = Utils.saveSelection();
Expand Down

0 comments on commit b93fc9d

Please sign in to comment.