123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- // Licensed Materials - Property of IBM
- //
- // IBM Cognos Products: pps
- //
- // (C) Copyright IBM Corp. 2005, 2017
- //
- // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- //The drag and Drop gloabl object that allows for a common Drag and Drop
- //Framework between Netscape and IE.
- function dragAndDropManager() {
-
- //Memeber variables
- this.isDragging = false;
- this.isXtabElementDragging = false;
- this.isCarrying = false;
- this.data = "";
- this.clickedItem = null;
- this.isMeasure = false;
- this.hierRootofDraggedCategory = 0;
- this.setDrag = function(text) {
- this.isDragging = true;
- this.data = text;
- }
- this.isDraggingAnItem = function() {
- return (this.isDragging || this.isXtabElementDragging || this.isCarrying);
- }
- this.setCarry = function(item) {
- this.isCarrying = true;
- this.isMeasure = gDimensionInfo[item.getAttribute("dimIdx")].isMeasureDimension;
- this.clickedItem = item;
- window.TreeToolBar.setAllButtons();
- }
- this.setHierRootOfDraggedCategory = function(hierRoot) {
- this.hierRootofDraggedCategory = hierRoot;
- }
- this.getHierRootOfDraggedCategory = function() {
- return this.hierRootofDraggedCategory;
- }
- this.setXtabElementDrag = function(obj) {
- this.isXtabElementDragging = true;
- this.data = obj;
- }
- this.cancelDrag = function() {
- if (this.isCarrying) {
- this.clickedItem = null;
- this.isCarrying = false;
- window.TreeToolBar.setAllButtons();
- }
- this.isDragging = false;
- this.isXtabElementDragging = false;
- this.hierRootofDraggedCategory = 0;
- window.DimTree.deselectAll();
- }
-
- this.getData = function() {
- if (this.isDragging || this.isXtabElementDragging)
- return this.data;
- else
- return "";
- }
- }
- function clickProcessDrop(event) {
- var dndManager = topparent.getGlobal("dndManager");
- if (dndManager.isCarrying) {
- processDrop(event);
- }
- }
- function clearDrag(event) {
- var dndManager = topparent.getGlobal("dndManager");
- if (dndManager.isCarrying) {
- dndManager.cancelDrag();
- }
- }
- function dropOrSelect(event) {
- if (topparent.getGlobal("dndManager").isCarrying)
- processDrop(event);
- else
- processSelection(event);
- }
- function dragMouseOver(event) {
- if (topparent.getGlobal("dndManager").isCarrying)
- processDragEnter(event);
- }
- function dragMouseOut(event) {
- if (topparent.getGlobal("dndManager").isCarrying)
- processDragLeave(event);
- }
- function preventNetscapeDrag(event) {
- // Deprecated function: Drag&Drop now enabled on all browsers
- // var eventM = new eventManager(event);
- // eventM.preventDefault();
- }
|