Changeset 7443
- Timestamp:
- Feb 19, 2018, 1:42:01 PM (5 years ago)
- Location:
- branches/3.11-stable/www/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.11-stable/www/include/scripts/main-2.js
r7421 r7443 3832 3832 // Position the dropdown 3833 3833 var pos = select.getFixedDropDownPosition(element); 3834 dropdownDiv.style.width = (pos.width)+'px'; 3835 dropdownDiv.style.left = (pos.left)+'px'; 3836 3834 dropdownDiv.style.left = pos.left; 3835 dropdownDiv.style.right = pos.right; 3836 dropdownDiv.style.width = pos.width; 3837 dropdownDiv.style.minWidth = pos.minWidth; 3838 dropdownDiv.style.maxWidth = pos.maxWidth; 3839 3837 3840 // Show it 3838 3841 Doc.addClass(element, 'active'); … … 3852 3855 // Position the dropdown div relative the main element 3853 3856 var fpos = Doc.getElementPosition(element); 3854 3855 // Assume the same as the main element 3857 3856 3858 var dpos = {}; 3857 dpos.left = fpos.left+1; 3858 dpos.width = fpos.width; 3859 3860 if (dpos.width < 150) 3861 { 3862 // The dropdown should be at least 150px wide. 3863 dpos.width = 150; 3864 3859 3860 // The default is to make the drop-down the same size as the filter 3861 dpos.left = (fpos.left+1)+'px'; 3862 dpos.width = (fpos.width)+'px'; 3863 dpos.right = 'auto'; 3864 dpos.minWidth = (Math.max(fpos.width, 150))+'px'; 3865 dpos.maxWidth = 'auto'; 3866 3867 if (fpos.width < 300) 3868 { 3869 // If the width is smaller than 300 we should open up either 3870 // to the left or to the right, we need to check how close we are to 3871 // the right side 3865 3872 try 3866 3873 { … … 3874 3881 } 3875 3882 if (p==null) p = document.body; 3876 3883 3877 3884 // Get position data for the parent 3878 // + 30should be safe to account for a scrollbar3885 // +16 should be safe to account for a scrollbar 3879 3886 var ppos = Doc.getElementPosition(p); 3880 var scrollbar = p.scrollHeight > p.clientHeight ? 30: 0;3887 var scrollbar = p.scrollHeight > p.clientHeight ? 16 : 0; 3881 3888 var maxRight = ppos.width + p.scrollLeft - scrollbar; 3882 3883 // Right-align the dropdown if it overflows 3884 if (dpos.left + dpos.width > maxRight) 3889 3890 dpos.width = 'auto'; 3891 dpos.maxWidth = '300px'; 3892 if (fpos.left + 300 > maxRight) 3885 3893 { 3886 dpos.left = fpos.right - 148; 3894 // Align to right 3895 dpos.left = 'auto'; 3896 dpos.right = (ppos.right-fpos.right-scrollbar)+'px'; 3887 3897 if (fpos.right > maxRight) 3888 3898 { … … 3902 3912 } 3903 3913 } 3904 3905 3914 return dpos; 3906 3915 } … … 4061 4070 optionDiv.innerHTML = options[i].value; 4062 4071 options[i].div = optionDiv; 4072 optionDiv.title = options[i].value; 4063 4073 allOptionsDiv.appendChild(optionDiv); 4064 4074 Events.addEventHandler(optionDiv, 'click', internal.optionOnClick); … … 4251 4261 // Position the dropdown 4252 4262 var pos = select.getFixedDropDownPosition(activeSelect); 4253 dropdownDiv.style.width = (pos.width)+'px'; 4254 dropdownDiv.style.left = (pos.left)+'px'; 4263 dropdownDiv.style.left = pos.left; 4264 dropdownDiv.style.right = pos.right; 4265 dropdownDiv.style.width = pos.width; 4266 dropdownDiv.style.minWidth = pos.minWidth; 4267 dropdownDiv.style.maxWidth = pos.maxWidth; 4255 4268 } 4256 4269 … … 4296 4309 // Position the dropdown 4297 4310 var pos = MultiSelect.getFixedDropDownPosition(element); 4298 dropdownDiv.style.width = (pos.width)+'px'; 4299 dropdownDiv.style.left = (pos.left)+'px'; 4311 dropdownDiv.style.left = pos.left; 4312 dropdownDiv.style.right = pos.right; 4313 dropdownDiv.style.width = pos.width; 4314 dropdownDiv.style.minWidth = pos.minWidth; 4315 dropdownDiv.style.maxWidth = pos.maxWidth; 4300 4316 4301 4317 // Show it … … 4647 4663 // Position the dropdown 4648 4664 var pos = MultiSelect.getFixedDropDownPosition(activeEnum); 4649 dropdownDiv.style.width = (pos.width)+'px'; 4650 dropdownDiv.style.left = (pos.left)+'px'; 4665 dropdownDiv.style.left = pos.left; 4666 dropdownDiv.style.right = pos.right; 4667 dropdownDiv.style.width = pos.width; 4668 dropdownDiv.style.minWidth = pos.minWidth; 4669 dropdownDiv.style.maxWidth = pos.maxWidth; 4651 4670 } 4652 4671 -
branches/3.11-stable/www/include/styles/main.css
r7335 r7443 977 977 margin-left: -2px; 978 978 margin-top: 2px; 979 min-width: 150px; 979 980 } 980 981 981 982 div.smartenum 982 983 { 983 height: 20em; 984 min-height: 15em; 985 max-height: 30em; 984 986 } 985 987 … … 1045 1047 .multioptionoptions 1046 1048 { 1047 height: 20em; 1049 min-height: 15em; 1050 max-height: 30em; 1048 1051 overflow: auto; 1049 1052 }
Note: See TracChangeset
for help on using the changeset viewer.