Changeset 8403

Show
Ignore:
Timestamp:
05/02/07 13:32:37 (19 months ago)
Author:
sjmiles
Message:

Updated code in various modules to reflect changes in Dojo r8402. Refs #2641.
*disconnect*: changed disconnect so that it only takes one argument: the handle returned from connect, simplifying client code that needs to manage connections.

Location:
dijit/trunk
Files:
1 added
7 modified

Legend:

Unmodified
Added
Removed
  • dijit/trunk/base/Widget.js

    r8389 r8403  
    153153                                delete this.bgIframe; 
    154154                        } 
    155                         if(!finalize && this.domNode){ 
    156                                 dojo.cleanNodeEvents(this.domNode); 
    157                         } 
    158155                }catch(e){ /* squelch! */ } 
    159156                try{ 
  • dijit/trunk/layout/SplitContainer.js

    r8391 r8403  
    384384                // 
    385385 
    386                 dojo.connect(document.documentElement, "onmousemove", this, "changeSizing"); 
    387                 dojo.connect(document.documentElement, "onmouseup", this, "endSizing"); 
     386                this.sizingEvents = [ 
     387                        dojo.connect(document.documentElement, "onmousemove", this, "changeSizing"), 
     388                        dojo.connect(document.documentElement, "onmouseup", this, "endSizing") 
     389                ]; 
    388390                dojo.stopEvent(e); 
    389391        }, 
     
    413415                this.isSizing = false; 
    414416 
    415                 dojo.disconnect(document.documentElement, "onmousemove", this, "changeSizing"); 
    416                 dojo.disconnect(document.documentElement, "onmouseup", this, "endSizing"); 
     417                dojo.forEach(this.sizingEvents, dojo.disconnect); 
    417418                 
    418419                if(this.persist){ 
  • dijit/trunk/Menu.js

    r8379 r8403  
    382382                this._highlightItem(); 
    383383 
    384                 this.containerNode.focus(); 
     384                try{ 
     385                        this.containerNode.focus(); 
     386                }catch(e){ 
     387                        // this throws on IE (at least) in some scenarios 
     388                } 
    385389 
    386390                if(this.is_hovering){ this._stopSubmenuTimer(); } 
  • dijit/trunk/tests/test_Menu.html

    r8339 r8403  
    88        @import "../themes/tundra/tundra.css"; 
    99        @import "css/dijitTests.css"; 
    10  
    1110</style> 
    12 <script type="text/javascript" src="../../dojo/dojo.js" 
    13         djConfig="isDebug: true, debugAtAllCosts: true"></script> 
     11<script type="text/javascript" src="../../dojo/dojo.js" djConfig="isDebug: true, debugAtAllCosts: true"></script> 
    1412<script language="JavaScript" type="text/javascript"> 
    1513        dojo.require("dijit.Menu"); 
  • dijit/trunk/tests/test_Tooltip.html

    r8359 r8403  
    44<head> 
    55        <title>Dojo Tooltip Widget Test</title> 
    6         <script type="text/javascript" src="../../dojo/dojo.js" 
    7                 djConfig="isDebug: true, debugAtAllCosts: true"></script> 
     6        <script type="text/javascript" src="../../dojo/dojo.js" djConfig="isDebug: true, debugAtAllCosts: true"></script> 
    87        <script type="text/javascript"> 
    98                dojo.require("dijit.Tooltip"); 
     
    3231<body class="tundra"> 
    3332        <h1 class="testTitle">Tooltip test</h1> 
    34         <p>Mouse-over the items below to test tooltips:</p> 
     33        <p>Mouse-over the items below to test tooltips. <button onclick="dijit.byId('btnTt').destroy()">Remove</button> tooltip from button.</p> 
    3534        <p> 
    3635                <span id="one" class="tt">text</span> 
     
    4746         
    4847        <button id="four">button</button> 
    49         <span dojoType="dijit.Tooltip" connectId="four" caption="tooltip on button" style="display:none;"></span> 
     48        <span id="btnTt" dojoType="dijit.Tooltip" connectId="four" caption="tooltip on button" style="display:none;"></span> 
    5049 
    5150    <select id="seven"> 
     
    6463                <input type="input" id="id2" value="1"/><br> 
    6564                <input type="input" id="id3" value="2"/><br> 
    66  
    6765                <input type="input" id="id4" value="3"/><br> 
    68         <input type="input" id="id5" value="4"/><br> 
     66    <input type="input" id="id5" value="4"/><br> 
    6967                <input type="input" id="id6" value="5"/><br> 
    7068        </form> 
  • dijit/trunk/Tooltip.js

    r8350 r8403  
    113113                connectId: "", 
    114114 
    115                 // A hash to hold connect handles for cleanup 
    116                 _connections: [], 
    117  
    118115                postCreate: function(){ 
     116                        // An array to hold connect handles for cleanup (per instance) 
     117                        this._connections = []; 
     118                         
    119119                        this._connectNode = dojo.byId(this.connectId); 
    120120 
    121121                        dojo.forEach(["onMouseOver", "onHover", "onMouseOut", "onUnHover"], function(event){ 
    122                                 this._connections.event = dojo.connect(this._connectNode, event.toLowerCase(), this, "_"+event); 
     122                                this._connections.push(dojo.connect(this._connectNode, event.toLowerCase(), this, "_"+event)); 
    123123                        }, this); 
    124124                }, 
     
    134134                                        return true; // boolean 
    135135                                } 
    136                                 node = node.parentNode; 
     136                                try{ 
     137                                        node = node.parentNode; 
     138                                }catch(e){ 
     139                                        return true; 
     140                                } 
    137141                        } 
    138142                        return false; // boolean 
     
    198202                uninitialize: function(){ 
    199203                        this.close(); 
    200                         for(var event in this._connections){ 
    201                                 dojo.disconnect(this._connectNode, event, this._connections.event); 
    202                         } 
     204                        dojo.forEach(this._connections, dojo.disconnect); 
    203205                        this._connections = {}; 
    204206                } 
  • dijit/trunk/util/PopupManager.js

    r8374 r8403  
    190190 
    191191                if(command == 'connect'){ 
    192                         targetWindow._onmousedownhandler = dojo.connect(targetWindow.document, 'onmousedown', null, onMouse); 
     192                        targetWindow._onmousedownhandler = dojo.connect(targetWindow.document, "onmousedown", null, onMouse); 
    193193                        targetWindow._onscrollhandler = dojo.connect(targetWindow, "onscroll", null, onMouse); 
    194194                        targetWindow._onkeyhandler = dojo.connect(targetWindow.document, "onkeypress", null, onKeyPress); 
    195195                }else{ 
    196                         dojo.disconnect(targetWindow.document, 'onmousedown', targetWindow._onmousedownhandler); 
     196                        dojo.disconnect(targetWindow._onmousedownhandler); 
    197197                        targetWindow._onmousedownhandler = null; 
    198                         dojo.disconnect(targetWindow, "onscroll", targetWindow._onscrollhandler); 
     198                        dojo.disconnect(targetWindow._onscrollhandler); 
    199199                        targetWindow._onscrollhandler = null; 
    200                         dojo.disconnect(targetWindow.document, "onkeypress", targetWindow._onkeyhandler); 
     200                        dojo.disconnect(targetWindow._onkeyhandler); 
    201201                        targetWindow._onkeyhandler = null; 
    202202                }