Changeset 6514


Ignore:
Timestamp:
09/11/06 23:57:50 (5 years ago)
Author:
sam
Message:

Correction lib dd

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Wsp_Modeling/spaces/gen/modelBuilder/bs.doss/_common/sm/webSiteGenerator/scDragMgr.js

    r6503 r6514  
    7777        }, 
    7878 
     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 
    7984        // Retrieve an array of all containers of the specified key that are contained in pRootNode 
    8085        getContainers : function (pKey, pRootNode) { 
     
    113118                if (navigator.userAgent.toLowerCase().indexOf("khtml") != -1) return 
    114119                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 
    115125        }, 
    116126 
     
    734744                        pCatchment.xOnDragOver = this._onDragOver 
    735745                        pCatchment.xOnDragOut = this._onDragOut 
     746                        pCatchment.fInitClass = pCatchment.className 
    736747                         
    737748                        // each catchment becomes a linked catchment node 
     
    752763                                pCatchment.fContainer = pContainer 
    753764                                this.setMode(pContainer, "ordered", -1) 
     765                                this.setDragOverClass(pContainer, "") 
    754766                        } 
    755767                        // init IfEmpty elt 
     
    790802        }, 
    791803 
     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 
    792810        // EXTERNAL - CONTAINER - Retrieve an array of all containers of the specified key that are contained in pRootNode 
    793811        getContainers : function(pKey, pRootNode) { 
     
    884902                        pLabel.fLastParent = null 
    885903                        pLabel.fKey = vKey 
     904                        pLabel.fInitClass = pLabel.className 
    886905                        pLabel.fGroup = vGroup 
    887906                        pLabel.xDropCallback = new Function() 
     
    923942        }, 
    924943 
     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 
    925950        // EXTERNAL - LABEL - Returns a string rep of the label's position 
    926951        saveLabelPos : function (pLabel) { 
     
    9831008                        } 
    9841009                } 
    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                } 
    9871017                return vHasItems 
    9881018        }, 
     
    9961026                vItem.fLastContainer = null 
    9971027                vCurrentCatchment.onDragOut() 
     1028                vCurrentCatchment.className = vCurrentCatchment.fInitClass 
    9981029                vCurrentCatchment.fContainer.removeChild(vItem) 
    9991030                vCurrentCatchment.xUpdateGui() 
    10001031                scDragMgr.dragdrop.fDragContainer.style["position"] = 'absolute' 
    10011032                scDragMgr.dragdrop.fDragContainer.style["top"] = '0px' 
    1002                 scDragMgr.dragdrop.fDragContainer.className = vCurrentContainer.className 
     1033//              scDragMgr.dragdrop.fDragContainer.className = vCurrentContainer.className 
    10031034                document.body.appendChild(scDragMgr.dragdrop.fDragContainer) 
    10041035                scDragMgr.dragdrop.fDragContainer.appendChild(vItem) 
     
    10261057                        var vCurrentCatchment = vItem.parentNode.fCatchment 
    10271058                        vCurrentCatchment.onDragOut() 
     1059                        vCurrentCatchment.className = vCurrentCatchment.fInitClass 
    10281060                        vCurrentCatchment.fContainer.removeChild(vItem) 
    10291061                        vCurrentCatchment.xUpdateGui() 
     
    10331065                this.xUpdateGui() 
    10341066                this.onDragOver() 
     1067                this.className = this.fInitClass + " " + this.fDragOverClass 
    10351068        }, 
    10361069        _onDragOut : function(pDragEvent) { 
     
    10931126                vItem.fStartContainer = vItem.parentNode 
    10941127                vItem.fLastContainer = vItem.fStartContainer 
     1128                vItem.className = vItem.fInitClass + " " + vItem.fDragClass 
    10951129                vItem.parentNode.fCatchment.onDragOver() 
     1130                vItem.parentNode.fCatchment.className = vItem.parentNode.fCatchment.fInitClass + " " + vItem.parentNode.fCatchment.fDragOverClass 
    10961131        }, 
    10971132        _onDragMove : function(pDragEvent) { 
     
    11291164                        vItem.fStartContainer.fCatchment.xOnDragOver(pDragEvent, vItem.fStartContainer.fCatchment) 
    11301165                } 
     1166                vItem.className = vItem.fInitClass 
    11311167                vItem.parentNode.fCatchment.onDragOut() 
     1168                vItem.parentNode.fCatchment.className = vItem.parentNode.fCatchment.fInitClass 
    11321169                if (vItem.fForceDropCallback || vItem.fStartContainer != vItem.parentNode) { 
    11331170                        try{ 
    11341171                                vItem.xDropCallback() 
    1135                         } catch (e){ 
     1172                        } catch (vError){ 
    11361173                                scDragMgr.utilities.logError("dragdrop._onDragEnd: "+vError) 
    11371174                        } 
Note: See TracChangeset for help on using the changeset viewer.