8
0
فهرست منبع

Outdent using classes should be enabled if block has first indent.

Maciej Gołaszewski 6 سال پیش
والد
کامیت
55dfce6d7c

+ 1 - 1
packages/ckeditor5-indent/src/indentcommandbehavior/indentusingclasses.js

@@ -45,7 +45,7 @@ export default class IndentUsingClasses {
 		if ( this.isForward ) {
 			return currentIndex < this.classes.length - 1;
 		} else {
-			return currentIndex > 0;
+			return currentIndex >= 0;
 		}
 	}
 

+ 5 - 0
packages/ckeditor5-indent/tests/indentblockcommand.js

@@ -169,6 +169,11 @@ describe( 'IndentBlockCommand', () => {
 					expect( command.isEnabled ).to.be.false;
 				} );
 
+				it( 'should be true in indented block onf first indentation class', () => {
+					setData( model, '<paragraph blockIndent="indent-1">f[]oo</paragraph>' );
+					expect( command.isEnabled ).to.be.true;
+				} );
+
 				it( 'should be true in indented block and there are still indentation classes', () => {
 					setData( model, '<paragraph blockIndent="indent-2">f[]oo</paragraph>' );
 					expect( command.isEnabled ).to.be.true;