Opened 8 years ago

Last modified 5 years ago

#4454 confirmed New Feature

CKEditor should resize itself automatically in resizable floating window

Reported by: Wiktor Walc Owned by:
Priority: Normal Milestone:
Component: General Version: 3.0
Keywords: Discussion Cc:

Description

CKEditor behaves in a different way than FCKeditor when height is set to percentage value.

Suppose we have a floating resizable window, where the editor is running. When height of the editor is set to 95% and window is resized, CKEditor does not change its height. FCKeditor adjusts its height to match the new size of the window without any problems.

CKEditor can be easily changed to work in a similar way as FCKeditor, by changing the CSS style to:

.cke_skin_kama .cke_editor{
  display:inline-table;
  width:100%;
  height:95%; /* < --- added */
}

in skins/kama/editor.css

.. but this way the "resize" plugin stops working.

Attachments (1)

resizewithwindow.plugin.js (2.8 KB) - added by Paul Veldema 5 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 6 years ago by Jakub Ś

Status: newconfirmed

comment:2 Changed 6 years ago by Garry Yao

The design of v3 UI doesn't support for percentage height as explained by our documentation, this problem will be addressed in a re-invented UI in v4.

comment:3 Changed 5 years ago by Paul Veldema

v4 is out. Is it now possible through css? Or is this still a work in progress?

comment:4 Changed 5 years ago by Paul Veldema

For those that do not want to wait on a css solution I made a plugin to do this for ckeditor 4.1.

A litle quirk is that you also need the following css for it to work correctly:

.cke_chrome {
	padding: 0 !important;
}

The plugin file is called: resizewithwindow.plugin.js I will upload is in a moment.

Changed 5 years ago by Paul Veldema

Attachment: resizewithwindow.plugin.js added

comment:5 Changed 5 years ago by Jakub Ś

@pauljvrw to get your proposed fix tested and applied (if it is correct) please fork CKEditor 4 code from https://github.com/ckeditor/ckeditor-dev, prepare your fix and make a "pull request" (here is the example list of pull requests https://github.com/ckeditor/ckeditor-dev/pulls?direction=desc&page=1&sort=created&state=open). In comment please specify link to bug for which this fix was prepared. This is much faster way to get proposed fixes implemented/rejected (if they are invalid) in V4.

comment:6 Changed 5 years ago by Olek Nowodziński

Pull request with a community-submitted solution in form of a plugin.

comment:7 Changed 5 years ago by Paul Veldema

After some consultation on github this plugin is now added to the custom plug-ins. See: http://ckeditor.com/addon/resizewithwindow A separate github repository has been created for its maintenance (link on the addon page).

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy