123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- function CFilterContextMenu(sFilterGroupId)
- {
- var df = getDialogFrame();
- var cf = getConfigFrame();
- this.m_contextMenu = new CMenu('filterContextMenu', cf.gMenuStyle, goDialogManager.getReportFrame().oCVQS.getWebContentRoot());
- this.m_andButton =
- new CMenuItem(
- this.m_contextMenu,
- cf.gsFilterOperatorANDdesc,
- "getDialogFrame().cOp('" + sFilterGroupId + "','AND');",
- '',
- cf.gMenuItemStyle,
- goDialogManager.getReportFrame().oCVQS.getWebContentRoot(),
- goDialogManager.getReportFrame().oCVQS.getSkin() );
- this.m_orButtom =
- new CMenuItem(
- this.m_contextMenu,
- cf.gsFilterOperatorORdesc,
- "getDialogFrame().cOp('" + sFilterGroupId + "','OR');",
- '',
- cf.gMenuItemStyle,
- goDialogManager.getReportFrame().oCVQS.getWebContentRoot(),
- goDialogManager.getReportFrame().oCVQS.getSkin() );
- this.m_contextMenu.setHTMLContainer(df.document.body);
- this.m_contextMenu.draw();
- };
- function CFilterContextMenu_draw(evt, sFilterGroupId)
- {
- var df = getDialogFrame();
-
- var pageWidth = 0;
- if(typeof window.innerWidth != "undefined")
- {
- pageWidth = window.innerWidth;
- }
- else
- {
- pageWidth = document.body.clientWidth;
- }
-
- var pageHeight = 0;
- if(typeof window.innerHeight != "undefined")
- {
- pageHeight = window.innerHeight;
- }
- else
- {
- pageHeight = document.body.clientHeight;
- }
- if (df.gFContextMenu instanceof CFilterContextMenu && df.gFContextMenu.m_contextMenu instanceof CMenu)
- {
- df.gFContextMenu.m_contextMenu.remove();
- }
- df.gFContextMenu = new CFilterContextMenu(sFilterGroupId);
- var x = evt.clientX;
-
- if((x + df.gFContextMenu.m_contextMenu.getHTMLDiv().offsetWidth) > pageWidth)
- {
- x -= ((x + df.gFContextMenu.m_contextMenu.getHTMLDiv().offsetWidth) - pageWidth);
- }
- var y = evt.clientY;
-
- if(((y + df.gFContextMenu.m_contextMenu.getHTMLDiv().offsetHeight) > pageHeight) && (y - (df.gFContextMenu.m_contextMenu.getHTMLDiv().offsetHeight + myParentHTMLElement.clientHeight) >= 0))
- {
- y -= (df.gFContextMenu.m_contextMenu.getHTMLDiv().offsetHeight + myParentHTMLElement.clientHeight);
- }
- df.gFContextMenu.m_contextMenu.setXCoord(x);
- df.gFContextMenu.m_contextMenu.setYCoord(y);
- df.gFContextMenu.m_contextMenu.show();
- };
- function CFilterContextMenu_hide(evt)
- {
- var df = getDialogFrame();
- if (df.gFContextMenu instanceof CFilterContextMenu && df.gFContextMenu.m_contextMenu instanceof CMenu)
- {
- df.gFContextMenu.m_contextMenu.remove();
- }
- };
- CFilterContextMenu.prototype.draw = CFilterContextMenu_draw;
- CFilterContextMenu.prototype.hide = CFilterContextMenu_hide;
|