IDEMPIERE-4739 Fix Height of HTML Text Editor not responsive (#1350)

This commit is contained in:
Anozi Mada 2022-06-01 13:01:33 +07:00 committed by GitHub
parent 4e1515f52a
commit da83283d74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 7 deletions

View File

@ -84,6 +84,7 @@ import org.zkoss.zul.Borderlayout;
import org.zkoss.zul.Cell; import org.zkoss.zul.Cell;
import org.zkoss.zul.Center; import org.zkoss.zul.Center;
import org.zkoss.zul.Div; import org.zkoss.zul.Div;
import org.zkoss.zul.North;
import org.zkoss.zul.South; import org.zkoss.zul.South;
/** /**
@ -204,6 +205,8 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
setAttachment(attachment); setAttachment(attachment);
setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED); setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED);
addEventListener(Events.ON_CANCEL, e -> onCancel()); addEventListener(Events.ON_CANCEL, e -> onCancel());
addEventListener(Events.ON_SIZE, e -> onSize());
addEventListener(Events.ON_MAXIMIZE, e -> onSize());
} // commonInit } // commonInit
@ -373,11 +376,8 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
attachmentBox.appendChild(item); attachmentBox.appendChild(item);
} }
row = new Row(); fMessage.setWidth("100%");
rows.appendChild(row); fMessage.setHeight("100%");
row.appendCellChild(fMessage, 2);
fMessage.setHflex("2");
fMessage.setHeight("350px");
confirmPanel.addActionListener(this); confirmPanel.addActionListener(this);
@ -409,11 +409,16 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
this.appendChild(borderlayout); this.appendChild(borderlayout);
ZKUpdateUtil.setWidth(borderlayout, "100%"); ZKUpdateUtil.setWidth(borderlayout, "100%");
North northPane = new North();
northPane.setSclass("dialog-content");
northPane.setAutoscroll(true);
borderlayout.appendChild(northPane);
northPane.appendChild(grid);
Center centerPane = new Center(); Center centerPane = new Center();
centerPane.setSclass("dialog-content"); centerPane.setSclass("dialog-content");
centerPane.setAutoscroll(true);
borderlayout.appendChild(centerPane); borderlayout.appendChild(centerPane);
centerPane.appendChild(grid); centerPane.appendChild(fMessage);
South southPane = new South(); South southPane = new South();
southPane.setSclass("dialog-footer"); southPane.setSclass("dialog-footer");
@ -622,6 +627,10 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
private void onCancel() { private void onCancel() {
onClose(); onClose();
} }
private void onSize() {
fMessage.invalidate();
}
/** /**
* @param dataSource * @param dataSource

View File

@ -186,6 +186,8 @@ public class WTextEditorDialog extends Window implements EventListener<Event>{
setSizable(true); setSizable(true);
setMaximizable(true); setMaximizable(true);
addEventListener(Events.ON_CANCEL, e -> onCancel()); addEventListener(Events.ON_CANCEL, e -> onCancel());
addEventListener(Events.ON_SIZE, e -> onSize());
addEventListener(Events.ON_MAXIMIZE, e -> onSize());
} }
private void createEditor(org.zkoss.zul.Tabpanel tabPanel) { private void createEditor(org.zkoss.zul.Tabpanel tabPanel) {
@ -255,6 +257,10 @@ public class WTextEditorDialog extends Window implements EventListener<Event>{
detach(); detach();
} }
private void onSize() {
editor.invalidate();
}
private void updateStatus(int newLength) { private void updateStatus(int newLength) {
if (status != null && maxSize > 0) { if (status != null && maxSize > 0) {
StringBuilder msg = new StringBuilder(); StringBuilder msg = new StringBuilder();