Opened 10 years ago
Closed 9 years ago
#13434 closed Bug (fixed)
Dialog busy state indicator is broken in RTL
Reported by: | Olek Nowodziński | Owned by: | Tade0 |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 4.5.2 |
Component: | UI : Dialogs | Version: | 4.5.0 Beta |
Keywords: | Cc: |
Description (last modified by )
It looks like no one tested the feature in RTL env. The position of the spinner is wrong. Implemented in #13213.
Attachments (1)
Change History (10)
Changed 10 years ago by
Attachment: | dialog-busy-rtl.png added |
---|
comment:1 Changed 10 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 10 years ago by
Status: | new → confirmed |
---|
comment:3 Changed 10 years ago by
Owner: | set to Tade0 |
---|---|
Status: | confirmed → assigned |
comment:4 Changed 10 years ago by
Status: | assigned → review |
---|
comment:5 Changed 10 years ago by
Status: | review → review_failed |
---|
Tests
- Missing white space in
**upper left corner**(**upper _right_ corner**
https://github.com/cksource/ckeditor-dev/blame/be63bb8da05d53d1fac2baa6f2193cd94694bfff/tests/plugins/dialog/manual/state.md#L10 - No loops are needed,
instanceLoaded
andCKEDITOR.replaceAll
will do the trick:<textarea cols="80" name="en" class="ckeditor" rows="10"></textarea> ... <textarea cols="80" name="he" class="ckeditor" rows="10"></textarea>
andCKEDITOR.on( 'instanceLoaded', function( evt ) { CKEDITOR.dialog.add( 'state', function() { return { title: 'Dialog with state indicator', ... }; } ); } ); CKEDITOR.replaceAll( function( el, config ) { CKEDITOR.tools.extend( config, { language: el.getAttribute( 'name' ), on: { pluginsLoaded: function() { this.addCommand( 'state', new CKEDITOR.dialogCommand( 'state' ) ); this.addCommand( 'setRtl', { exec: function( editor ) { } } ); this.ui.addButton( 'state', { label: 'Show a dialog with state indicator', command: 'state', } ); } } } ); } );
Code
- Code–style (i.e.
spinnerDesc.styles['float']
vsspinnerDesc.styles[ 'float' ]
) this.getParentEditor()
instead ofthis._.editor
- Save bytes. Instead of
var spinnerDesc = { attributes: { 'class': 'cke_dialog_spinner' }, styles: {} }; if ( this._.editor.lang.dir == 'rtl' ) { spinnerDesc.styles['float'] = 'right'; spinnerDesc.styles['margin-left'] = '8px'; } else { spinnerDesc.styles['float'] = 'left'; spinnerDesc.styles['margin-right'] = '8px'; } this.parts.spinner = CKEDITOR.document.createElement( 'div', spinnerDesc );
you could dovar dir = this.getParentEditor().lang.dir, spinnerDef = { attributes: { 'class': 'cke_dialog_spinner' }, styles: { float: dir == 'rtl' ? 'right' : 'left' } }; spinnerDef.styles[ 'margin-' + ( dir == 'rtl' ? 'left' : 'right' ) ] = '8px'; this.parts.spinner = CKEDITOR.document.createElement( 'div', spinnerDef );
because things likestyles['float']
orstyles['margin-right']
will not be compressed in the building process.
comment:7 Changed 10 years ago by
Status: | review → review_passed |
---|
comment:8 Changed 10 years ago by
Pushed minor fixes to branch:t/13434 (HEAD at git:8178479). Waiting for master to switch from 4.4.8 to 4.5.1.
comment:9 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
Fixed on master with git:7c8521b.
Changes pushed to branch:t/13434.