Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch '6.0'

  • Loading branch information...
commit db829b04a75397d0d50b28ede55c77b8d753b04a 2 parents 60d0789 + bef54ab
@jumperchen jumperchen authored
View
4 zkdoc/release-note
@@ -2,6 +2,8 @@
ZK 6.5.1
* Features
ZK-1351: Messagebox with no button
+ ZK-1397: DefaultTreeNode support empty children mean leaf node
+ ZK-1248: Sub menu should not overlap its parent in menupopup
* Bugs
ZK-1348: First child tree node can't unfold sometimes
@@ -99,6 +101,8 @@ ZK 6.0.3
ZK-1301: The buttons in the Messagebox shall use autodisable
ZK-1312: formattedNumber & formattedDate should use proper Locale & Timezone
ZK-1397: DefaultTreeNode support empty children mean leaf node
+ ZK-1248: Sub menu should not overlap its parent in menupopup
+
* Bugs
ZK-1128: Use SerializableUiFactory with a portal environment will cause ClassCastException
ZK-1303: listbox select mold with 1 rows onSelect event not fired for first item
View
37 zktest/src/archive/test2/F60-ZK-1248.zul
@@ -0,0 +1,37 @@
+<zk>
+ <div width="100%">
+ <window border="normal" mode="modal" context="mpp" title="menupopup" width="500px">
+ <label multiline="true">
+ 1. Move the modal window to the right side of browser.
+ 2. Right click on the right edge of window to open the menupopup.
+ 3. Hover on "About" menu.
+ 4. Should see sub-menu showed on the left of parent menu instead of overlapped.
+ </label>
+ </window>
+ <menupopup id="mpp">
+ <menu label="About">
+ <menupopup>
+ <menu label="About">
+ <menupopup>
+ <menu label="About">
+ <menupopup>
+ <menuitem label="About ZK" onClick="alert(self.label)" />
+ <menuitem label="About Potix" onClick="alert(self.label)" />
+ </menupopup>
+ </menu>
+ <menuitem label="About ZK" onClick="alert(self.label)" />
+ <menuitem label="About Potix" onClick="alert(self.label)" />
+ </menupopup>
+ </menu>
+ <menuitem label="About ZK" onClick="alert(self.label)" />
+ <menuitem label="About Potix" onClick="alert(self.label)" />
+ </menupopup>
+ </menu>
+ <menuitem image="/img/castle.png" label="New" onClick="alert(self.label)" />
+ <menuitem label="Open" onClick="alert(self.label)" />
+ <menuitem label="Save" onClick="alert(self.label)" />
+ <menuseparator />
+ <menuitem label="Exit" onClick="alert(self.label)" />
+ </menupopup>
+ </div>
+</zk>
View
1  zktest/src/archive/test2/config.properties
@@ -1657,6 +1657,7 @@ F60-ZK-951.zul=F60,A,E,Biglistbox,Model
F60-ZK-1047.zul=F60,Format,Function,VisionTest
F60-ZK-1018.zul=F60,Fusionchart,VisionTest
F61-ZK-1145.zul=F61,Notification,Closable
+F60-ZK-1248.zul=F60,Menupopup
F61-ZK-970.zul=F61,Tab,Caption,Tabbox
F61-ZK-1175.zul=F61,Calendar,Datebox
F61-ZK-120.zul=F61,Listbox,Listgroup,Menupopup
View
23 zul/src/archive/web/js/zul/menu/Menupopup.js
@@ -123,6 +123,26 @@ zul.menu.Menupopup = zk.$extends(zul.wgt.Popup, {
_hideShadow: function () {
if (this._shadow) this._shadow.hide();
},
+ _syncPos: function () {
+ var menu = _getMenu(this);
+ if (menu) {
+ var $menu = jq(menu.$n()),
+ $this = jq(this.$n()),
+ ofs1 = $menu.offset().left,
+ ofs2 = $this.offset().left,
+ width1 = $menu.outerWidth(),
+ width2 = $this.outerWidth(),
+ mp = menu.parent;
+
+ while(mp && !mp.$instanceof(zul.menu.Menupopup))
+ mp = mp.parent;
+
+ if (ofs2 < ofs1 + width1 / 2 || (mp && mp._shallSync)) {
+ this._shallSync = true;
+ $this.css('left', jq.px(ofs1 - width2));
+ }
+ }
+ },
close: function () {
if (this.isOpen())
zul.menu._nOpen--;
@@ -138,6 +158,8 @@ zul.menu.Menupopup = zk.$extends(zul.wgt.Popup, {
if (item) item.$class._rmActive(item);
this._curIndex = -1;
this.$class._rmActive(this);
+
+ this._shallSync = null;
},
open: function (ref, offset, position, opts) {
if (!this.isOpen())
@@ -155,6 +177,7 @@ zul.menu.Menupopup = zk.$extends(zul.wgt.Popup, {
}
this.$super('open', ref, offset, position, opts || {sendOnOpen: true, disableMask: true});
//open will fire onShow which invoke this.zsync()
+ this._syncPos(); //ZK-1248: re-sync position if sub-menu is overlapped on parent menu
var mb;
// adjust only for topmost menu in horizontal.
Please sign in to comment.
Something went wrong with that request. Please try again.