8
0
Pārlūkot izejas kodu

Rename variables and properties.

Mateusz Samsel 6 gadi atpakaļ
vecāks
revīzija
9c70ac030f

+ 1 - 1
packages/ckeditor5-link/src/linkui.js

@@ -157,7 +157,7 @@ export default class LinkUI extends Plugin {
 			const customAttributes = {};
 
 			for ( const switchButton of formView.customAttributesView ) {
-				customAttributes[ switchButton.value ] = switchButton.isOn;
+				customAttributes[ switchButton.name ] = switchButton.isOn;
 			}
 
 			editor.execute( 'link', formView.urlInputView.inputView.element.value, customAttributes );

+ 11 - 10
packages/ckeditor5-link/src/ui/linkformview.js

@@ -248,25 +248,26 @@ export default class LinkFormView extends View {
 	 * @returns {module:ui/viewcollection~ViewCollection} of Switch Buttons.
 	 */
 	_createCustomAttributesView() {
-		const checkboxes = this.createCollection();
+		const switches = this.createCollection();
 
-		checkboxes.bindTo( this.customAttributes ).using( item => {
-			const checkbox = new SwitchButtonView( this.locale );
-			checkbox.set( {
-				value: item.id,
+		switches.bindTo( this.customAttributes ).using( item => {
+			const switchButton = new SwitchButtonView( this.locale );
+
+			switchButton.set( {
+				name: item.id,
 				label: item.label,
 				withText: true
 			} );
 
-			checkbox.bind( 'isOn' ).to( item, 'value' );
+			switchButton.bind( 'isOn' ).to( item, 'value' );
 
-			checkbox.on( 'execute', () => {
-				this.customAttributes.get( item.id ).set( 'value', !checkbox.isOn );
+			switchButton.on( 'execute', () => {
+				item.set( 'value', !switchButton.isOn );
 			} );
 
-			return checkbox;
+			return switchButton;
 		} );
-		return checkboxes;
+		return switches;
 	}
 
 	/**