Details
-
Type: Improvement
-
Status: Closed
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 1.8
-
Fix Version/s: 1.8.1
-
Component/s: ICE-Components
-
Labels:None
-
Environment:all
Description
When a menubar is displayed at the right border of the browser window, the menu is shown outside of the window so that the user needs to scroll in order to see the menu.
This should be avoided by showing the menu on the left side of the menubar instead of the right side.
A patch to menu.js that works for us (not thoroughly tested):
show: function(supermenu,submenu,submenuDiv) {
supermenu=$(supermenu);
submenu=$(submenu);
submenuDiv=$(submenuDiv);
if (submenu) {
var menu = $(submenu);
//menu is already visible, don't do anything
if (menu && menu.style.display=='') return;
Ice.Menu.showMenuWithId(submenu);
if (submenuDiv) {
//ICE-3196
var left;
//check if menu is too far to the right
if (Ice.Menu.getPosition(supermenu,'Left')+supermenu.offsetWidth+submenu.offsetWidth>document.documentElement.scrollLeft+document.body.clientWidth){
left=-submenu.offsetWidth;
}else{
left=supermenu.offsetWidth;
}
//check if menu is too far on the botton
var top=0;
if (Ice.Menu.getPosition(supermenu,'Top')+submenu.offsetHeight>document.documentElement.scrollTop+document.body.clientHeight){
top=-submenu.offsetHeight+supermenu.offsetHeight;
}
submenu.clonePosition(supermenu, {setWidth:false, setHeight:false, offsetTop:top, offsetLeft:left});
submenu.clonePosition(submenuDiv, {setTop:false, setLeft:false, setWidth:false, setHeight:false});
} else {
//ICE-3196
submenu.clonePosition(supermenu, {setWidth:false, setHeight:false, offsetTop:supermenu.offsetHeight});
}
Ice.Menu.showIframe(submenu); //ICE-2066, ICE-2912
}
Ice.Menu.currentMenu = submenu;
},
This should be avoided by showing the menu on the left side of the menubar instead of the right side.
A patch to menu.js that works for us (not thoroughly tested):
show: function(supermenu,submenu,submenuDiv) {
supermenu=$(supermenu);
submenu=$(submenu);
submenuDiv=$(submenuDiv);
if (submenu) {
var menu = $(submenu);
//menu is already visible, don't do anything
if (menu && menu.style.display=='') return;
Ice.Menu.showMenuWithId(submenu);
if (submenuDiv) {
//
var left;
//check if menu is too far to the right
if (Ice.Menu.getPosition(supermenu,'Left')+supermenu.offsetWidth+submenu.offsetWidth>document.documentElement.scrollLeft+document.body.clientWidth){
left=-submenu.offsetWidth;
}else{
left=supermenu.offsetWidth;
}
//check if menu is too far on the botton
var top=0;
if (Ice.Menu.getPosition(supermenu,'Top')+submenu.offsetHeight>document.documentElement.scrollTop+document.body.clientHeight){
top=-submenu.offsetHeight+supermenu.offsetHeight;
}
submenu.clonePosition(supermenu, {setWidth:false, setHeight:false, offsetTop:top, offsetLeft:left});
submenu.clonePosition(submenuDiv, {setTop:false, setLeft:false, setWidth:false, setHeight:false});
} else {
//
submenu.clonePosition(supermenu, {setWidth:false, setHeight:false, offsetTop:supermenu.offsetHeight});
}
Ice.Menu.showIframe(submenu); //
}
Ice.Menu.currentMenu = submenu;
},
Issue Links
- duplicates
-
ICE-3620 Sub Menu Item should display on the left side if there is no space to display on the right
- Closed
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
Stefan Niederhauser
created issue -
Stefan Niederhauser
made changes -
Ken Fyten
made changes -
Summary | Show menus at the left/top of the menubar when it is too close to the right/bottom border of the browser viewport. | Prevent menus from displaying off the top of the browser viewport |
Salesforce Case | [] | |
Fix Version/s | 1.8.1 [ 10170 ] | |
Assignee Priority | P3 | |
Affects Version/s | 1.8 [ 10161 ] | |
Affects Version/s | 1.7.2 [ 10130 ] | |
Assignee | Yip Ng [ yip.ng ] | |
Priority | Major [ 3 ] | Minor [ 4 ] |
yip.ng
made changes -
Attachment | ScreenHunter_01.jpg [ 11721 ] |
yip.ng
made changes -
Attachment | ScreenHunter_01.jpg [ 11724 ] |
yip.ng
made changes -
Attachment | ScreenHunter_05.jpg [ 11730 ] |
yip.ng
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Ken Fyten
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
Assignee Priority | P3 |