Jelajahi Sumber

Fixed: JSHint issues.

Aleksander Nowodzinski 10 tahun lalu
induk
melakukan
9d575b2b2f

+ 2 - 2
packages/ckeditor5-engine/src/ui/region.js

@@ -33,9 +33,9 @@ CKEDITOR.define( [ 'Collection', 'Model' ], function( Collection, Model ) {
 			this.views = new Collection();
 
 			this.views.on( 'add', ( evt, view ) => this.el && this.el.appendChild( view.el ) );
-		};
+		}
 
-		destroy() {};
+		destroy() {}
 	}
 
 	return Region;

+ 10 - 7
packages/ckeditor5-engine/src/ui/view.js

@@ -3,6 +3,8 @@
  * For licensing, see LICENSE.md.
  */
 
+/* global document */
+
 'use strict';
 
 CKEDITOR.define( [ 'Collection', 'Model' ], function( Collection, Model ) {
@@ -27,7 +29,7 @@ CKEDITOR.define( [ 'Collection', 'Model' ], function( Collection, Model ) {
 			this.regions = new Collection();
 
 			this.regions.on( 'add', ( evt, region ) => this.el.appendChild( region.el ) );
-		};
+		}
 
 		/**
 		 * Element of this view.
@@ -39,8 +41,8 @@ CKEDITOR.define( [ 'Collection', 'Model' ], function( Collection, Model ) {
 				return this._el;
 			}
 
-			return this._el = this.render();
-		};
+			return ( this._el = this.render() );
+		}
 
 		/**
 		 * Binds a property of the model to a specific listener that
@@ -74,7 +76,7 @@ CKEDITOR.define( [ 'Collection', 'Model' ], function( Collection, Model ) {
 				// Set the initial state of the view.
 				executeCallback( el, model[ property ] );
 			};
-		};
+		}
 
 		/**
 		 * Renders {@link el} using {@link template}.
@@ -90,8 +92,9 @@ CKEDITOR.define( [ 'Collection', 'Model' ], function( Collection, Model ) {
 				return null;
 			}
 
-			var el = document.createElement( template.tag ),
-				attr, value;
+			var el = document.createElement( template.tag );
+			var attr;
+			var value;
 
 			// Set the text first.
 			if ( template.text ) {
@@ -128,7 +131,7 @@ CKEDITOR.define( [ 'Collection', 'Model' ], function( Collection, Model ) {
 			return el;
 		}
 
-		destroy() {};
+		destroy() {}
 	}
 
 	return View;

+ 8 - 5
packages/ckeditor5-engine/tests/ui/view.js

@@ -3,6 +3,8 @@
  * For licensing, see LICENSE.md.
  */
 
+/* global document, HTMLElement */
+
 'use strict';
 
 var modules = bender.amd.require( 'ckeditor', 'ui/view' );
@@ -38,8 +40,8 @@ describe( 'plain view', function() {
 
 describe( 'rich view', function() {
 	beforeEach( 'Create a test view instance', function() {
-		var View = modules[ 'ui/view' ],
-			Component = class extends View {
+		var View = modules[ 'ui/view' ];
+		var Component = class extends View {
 				constructor( model ) {
 					super( model );
 
@@ -70,12 +72,12 @@ describe( 'rich view', function() {
 										if ( value == 'foo' ) {
 											return value;
 										}
- 									} )
+									} )
 								}
 							}
 						]
-					}
-				};
+					};
+				}
 			};
 
 		view = new Component( {
@@ -110,5 +112,6 @@ describe( 'rich view', function() {
 function getOuterHtml( el ) {
 	var container = document.createElement( 'div' );
 	container.appendChild( el.cloneNode( 1 ) );
+
 	return container.innerHTML;
 }