Changeset 6514
- Timestamp:
- 09/11/06 23:57:50 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Wsp_Modeling/spaces/gen/modelBuilder/bs.doss/_common/sm/webSiteGenerator/scDragMgr.js
r6503 r6514 77 77 }, 78 78 79 // Set a class to be added to the container's catchment when a label is dragged over it 80 setDragOverClass : function(pContainer, pClass) { 81 this.dragdrop.setDragOverClass(pContainer, pClass); return this 82 }, 83 79 84 // Retrieve an array of all containers of the specified key that are contained in pRootNode 80 85 getContainers : function (pKey, pRootNode) { … … 113 118 if (navigator.userAgent.toLowerCase().indexOf("khtml") != -1) return 114 119 this.dragdrop.setConstraintBox(pLabel, pNode); return this 120 }, 121 122 // Set a class to be added to the label when it is dragged 123 setDragClass : function(pLabel, pClass) { 124 this.dragdrop.setDragClass(pLabel, pClass); return this 115 125 }, 116 126 … … 734 744 pCatchment.xOnDragOver = this._onDragOver 735 745 pCatchment.xOnDragOut = this._onDragOut 746 pCatchment.fInitClass = pCatchment.className 736 747 737 748 // each catchment becomes a linked catchment node … … 752 763 pCatchment.fContainer = pContainer 753 764 this.setMode(pContainer, "ordered", -1) 765 this.setDragOverClass(pContainer, "") 754 766 } 755 767 // init IfEmpty elt … … 790 802 }, 791 803 804 // EXTERNAL - CONTAINER - Set a class to be added to the container's catchment when a label is dragged over it 805 setDragOverClass : function(pContainer, pClass) { 806 if (pClass) pContainer.fCatchment.fDragOverClass = pClass 807 else pContainer.fCatchment.fDragOverClass = "" 808 }, 809 792 810 // EXTERNAL - CONTAINER - Retrieve an array of all containers of the specified key that are contained in pRootNode 793 811 getContainers : function(pKey, pRootNode) { … … 884 902 pLabel.fLastParent = null 885 903 pLabel.fKey = vKey 904 pLabel.fInitClass = pLabel.className 886 905 pLabel.fGroup = vGroup 887 906 pLabel.xDropCallback = new Function() … … 923 942 }, 924 943 944 // EXTERNAL - LABEL - Set a class to be added to the label when it is dragged 945 setDragClass : function(pLabel, pClass) { 946 if (pClass) pLabel.fDragClass = pClass 947 else pLabel.fDragClass = "" 948 }, 949 925 950 // EXTERNAL - LABEL - Returns a string rep of the label's position 926 951 saveLabelPos : function (pLabel) { … … 983 1008 } 984 1009 } 985 this.topLeftPosition = scDragMgr.coordinates.topLeftOffset(this) 986 this.bottomRightPosition = scDragMgr.coordinates.bottomRightOffset(this) 1010 // update all Catchment bounds, since they may have changed on a previous drag 1011 var vCatchment = scDragMgr.dragdrop.fFirstCatchments[this.fKey] 1012 while (vCatchment != null) { 1013 vCatchment.topLeftPosition = scDragMgr.coordinates.topLeftOffset(vCatchment) 1014 vCatchment.bottomRightPosition = scDragMgr.coordinates.bottomRightOffset(vCatchment) 1015 vCatchment = vCatchment.fNextCatchment 1016 } 987 1017 return vHasItems 988 1018 }, … … 996 1026 vItem.fLastContainer = null 997 1027 vCurrentCatchment.onDragOut() 1028 vCurrentCatchment.className = vCurrentCatchment.fInitClass 998 1029 vCurrentCatchment.fContainer.removeChild(vItem) 999 1030 vCurrentCatchment.xUpdateGui() 1000 1031 scDragMgr.dragdrop.fDragContainer.style["position"] = 'absolute' 1001 1032 scDragMgr.dragdrop.fDragContainer.style["top"] = '0px' 1002 scDragMgr.dragdrop.fDragContainer.className = vCurrentContainer.className1033 // scDragMgr.dragdrop.fDragContainer.className = vCurrentContainer.className 1003 1034 document.body.appendChild(scDragMgr.dragdrop.fDragContainer) 1004 1035 scDragMgr.dragdrop.fDragContainer.appendChild(vItem) … … 1026 1057 var vCurrentCatchment = vItem.parentNode.fCatchment 1027 1058 vCurrentCatchment.onDragOut() 1059 vCurrentCatchment.className = vCurrentCatchment.fInitClass 1028 1060 vCurrentCatchment.fContainer.removeChild(vItem) 1029 1061 vCurrentCatchment.xUpdateGui() … … 1033 1065 this.xUpdateGui() 1034 1066 this.onDragOver() 1067 this.className = this.fInitClass + " " + this.fDragOverClass 1035 1068 }, 1036 1069 _onDragOut : function(pDragEvent) { … … 1093 1126 vItem.fStartContainer = vItem.parentNode 1094 1127 vItem.fLastContainer = vItem.fStartContainer 1128 vItem.className = vItem.fInitClass + " " + vItem.fDragClass 1095 1129 vItem.parentNode.fCatchment.onDragOver() 1130 vItem.parentNode.fCatchment.className = vItem.parentNode.fCatchment.fInitClass + " " + vItem.parentNode.fCatchment.fDragOverClass 1096 1131 }, 1097 1132 _onDragMove : function(pDragEvent) { … … 1129 1164 vItem.fStartContainer.fCatchment.xOnDragOver(pDragEvent, vItem.fStartContainer.fCatchment) 1130 1165 } 1166 vItem.className = vItem.fInitClass 1131 1167 vItem.parentNode.fCatchment.onDragOut() 1168 vItem.parentNode.fCatchment.className = vItem.parentNode.fCatchment.fInitClass 1132 1169 if (vItem.fForceDropCallback || vItem.fStartContainer != vItem.parentNode) { 1133 1170 try{ 1134 1171 vItem.xDropCallback() 1135 } catch ( e){1172 } catch (vError){ 1136 1173 scDragMgr.utilities.logError("dragdrop._onDragEnd: "+vError) 1137 1174 }
Note: See TracChangeset
for help on using the changeset viewer.