Changeset 33

Show
Ignore:
Timestamp:
05/29/08 22:36:21 (6 months ago)
Author:
bi..@lilyapp.org
Message:

fix a bug in number where numbers would not be deselected if the clicks on another external

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lily/lily/chrome/content/externals/number.js

    r31 r33  
    113113                thisPtr.controller.patchController.attachPatchObserver(thisPtr.objID,"mousemove",mouseMoveFunc,"performance"); 
    114114                thisPtr.controller.patchController.attachPatchObserver(thisPtr.objID,"mouseup",mouseUpFunc,"performance"); 
    115                 thisPtr.controller.patchController.attachPatchObserver("canvas","click",numberDeselected,"performance");               
     115                thisPtr.controller.patchController.attachPatchObserver(thisPtr.objID,"mousedown",numberDeselected,"performance");              
    116116                numberSelected(); 
    117117        } 
     
    124124         
    125125        function numberDeselected(e) { 
    126                 if(e.target.id=="canvas" && isSelected) {              
     126                if(e.target.id.indexOf(thisPtr.objID)==-1 && isSelected) {             
    127127                        thisPtr.ui.contentContainer.style.borderLeft="4px double black";                                                                 
    128                         thisPtr.controller.patchController.removePatchObserver("canvas","mouseup",numberDeselected,"performance"); 
     128                        thisPtr.controller.patchController.removePatchObserver(thisPtr.objID,"mousedown",numberDeselected,"performance"); 
    129129                        thisPtr.controller.patchController.removePatchObserver(thisPtr.objID,"keypress",keyPressFunc,"performance"); 
    130130                        if(typein_buffer) updateValue(+typein_buffer);                   
     
    173173        function toggleEditabilityFunc() { 
    174174                if(isSelected) { 
    175                         numberDeselected({target:{id:"canvas"}}); 
     175                        numberDeselected({target:{id:"edit_state_change"}}); 
    176176                } else { 
    177177                        updateValue(+(intDisplay.innerHTML+floatDisplay.innerHTML));