Skip to content

Commit

Permalink
Merge pull request #875 from bob31231/B85-ZK-3516
Browse files Browse the repository at this point in the history
ZK-3516: horizontal splitter resizing incorrectly
  • Loading branch information
scribetw committed Sep 13, 2017
2 parents 5a17e73 + 6109f0a commit 2b3ba19
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions zkdoc/release-note
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ ZK 8.5.0
ZK-3604: hiding the first column causes inconsitent column widths
ZK-3286: Labels of days can't be clicked with safari
ZK-3731: native <a> tag link suppresed inside a zk component with click listener
ZK-3516: horizontal splitter resizing incorrectly

* Upgrade Notes

Expand Down
33 changes: 33 additions & 0 deletions zktest/src/archive/test2/B85-ZK-3516.zul
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
B85-ZK-3516.zul
Purpose:
Description:
History:
Fri Aug 25 11:52:15 CST 2017, Created by bobpeng
Copyright (C) 2017 Potix Corporation. All Rights Reserved.
-->
<zk>
<div style="position: fixed; background: white; border: 1px solid black; padding: 10px">
<label multiline="true">
1. Increase the width of the browser quickly. Expected: the width of splitter should always stay the same
2. Reduce the height of the browser, Expected: no scrollbar gap on the right
</label>
</div>
<div height="100%" width="100%">
<hbox hflex="1" vflex="1">
<cell>
<div hflex="1" vflex="1" style="border: 1px solid red"></div>
</cell>
<splitter/>
<cell>
<div hflex="1" vflex="1" style="border: 1px solid red"></div>
</cell>
</hbox>
</div>
</zk>
1 change: 1 addition & 0 deletions zktest/src/archive/test2/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2354,6 +2354,7 @@ B85-ZK-3604.zul=A,E,Listbox,Column,Visibility,Width,Display,Listheader,Listcell,
B85-ZK-3286.zul=A,E,Safari,datebox,click
B85-ZK-3717.zul=A,E,datebox,timebox,onBlur
B85-ZK-3731.zul=A,E,onClick,Native,event
B85-ZK-3516.zul=A,E,Splitter,hbox

##
# Features - 3.0.x version
Expand Down
8 changes: 8 additions & 0 deletions zul/src/archive/web/js/zul/box/Box.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,14 @@ zul.box.Box = zk.$extends(zul.Widget, {
//bug#3042306
resetSize_: function (orient) { //@Overrid zk.Widget#resetSize_, called when beforeSize
this.$supers(zul.Widget, 'resetSize_', arguments);

// B85-ZK-3516: remove size of frame
if (!zk.ie) {
var n = this.$n();
if (!n.scrollTop && !n.scrollLeft)
this.$n('frame').style[orient == 'w' ? 'width' : 'height'] = '';
}

var vert = this.isVertical(),
k = -1,
szes = this._sizes;
Expand Down
4 changes: 4 additions & 0 deletions zul/src/archive/web/js/zul/box/Splitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@ zul.box.Splitter = zk.$extends(zul.Widget, {

var node = this.$n(), pn = node.parentNode;
if (pn) {
// B85-ZK-3516: remove width of parent node
pn.style.width = '';

var bfcolps = 'before' == this.getCollapse();
if (this.isVertical()) {
node.style.width = '100%'; // Sandbox-Splitter: the width should be same as parent
Expand All @@ -278,6 +281,7 @@ zul.box.Splitter = zk.$extends(zul.Widget, {
onSize: _zkf,
beforeSize: function () {
this.$n().style[this.isVertical() ? 'width' : 'height'] = '';
this.$n('btn').style[this.isVertical() ? 'margin-left' : 'margin-top'] = '';
},

_fixszAll: function () {
Expand Down

0 comments on commit 2b3ba19

Please sign in to comment.