123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- /****************************************************************
- ** Licensed Materials - Property of IBM
- **
- ** BI and PM: qs
- **
- ** (C) Copyright IBM Corp. 2001, 2015
- **
- ** US Government Users Restricted Rights - Use, duplication or
- ** disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- *****************************************************************/
- // Copyright (C) 2008 Cognos ULC, an IBM Company. All Rights Reserved.
- // Cognos and the Cognos logo are trademarks of Cognos ULC (formerly Cognos Incorporated) in the United States and/or other countries. IBM and the IBM logo are trademarks of International Business Machines Corporation in the United States, or other countries, or both. Other company, product, or service names may be trademarks or service marks of others.
- 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;
|