Ticket #5973: TitlePane-Focus.patch

File TitlePane-Focus.patch, 3.7 kB (added by guest, 11 months ago)

Allows the focusNode to be moved, if desired.

  • dijit/tests/test_TitlePane.html

     
    1919                function randomMessageId(){ 
    2020                        return Math.floor(Math.random() * 3) + 3; 
    2121                } 
     22 
     23                dojo.declare("dijit.TestTitlePane", dijit.TitlePane, { 
     24                        templateString: '<div class="dijitTitlePane">' + 
     25                                                        '    <div class="dijitTitlePaneTitle" dojoAttachPoint="titleBarNode" style="cursor: default;">' + 
     26                                                        '        <div dojoAttachEvent="onclick:toggle,onkeypress: _onTitleKey,onfocus:_handleFocus,onblur:_handleFocus" tabindex="0"' + 
     27                                                        '                waiRole="button" dojoAttachPoint="focusNode,arrowNode" class="dijitInline dijitArrowNode" style="cursor: pointer;"><span dojoAttachPoint="arrowNodeInner" class="dijitArrowNodeInner"></span></div>' + 
     28                                                        '        <div dojoAttachPoint="titleNode" class="dijitTitlePaneTextNode"></div>' + 
     29                                                        '    </div>' + 
     30                                                        '    <div class="dijitTitlePaneContentOuter" dojoAttachPoint="hideNode">' + 
     31                                                        '        <div class="dijitReset" dojoAttachPoint="wipeNode">' + 
     32                                                        '            <div class="dijitTitlePaneContentInner" dojoAttachPoint="containerNode" waiRole="region" tabindex="-1">' + 
     33                                                        '            </div>' + 
     34                                                        '        </div>' + 
     35                                                        '    </div>' + 
     36                                                        '</div>' 
     37                }); 
     38 
    2239        </script> 
    2340 
    2441        <style type="text/css"> 
     
    87104                <p>And this is the closing line for the outer title pane. 
    88105        </div> 
    89106 
     107        <h1>Test #7: subclassed title pane (only arrow is selectable and focusable)</h1> 
     108        <div dojoType="dijit.TestTitlePane" title="Title Pane #7" style="width: 300px;"> 
     109                Lorem Ipsum Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque 
     110                iaculis, nulla id semper faucibus, pede tellus nonummy magna, vitae adipiscing 
     111                orci arcu ut augue. Nunc condimentum, magna a vestibulum convallis, libero purus 
     112                pulvinar orci, sed vestibulum urna sem ut pede. More Ipsum... 
     113                Sed sollicitudin suscipit risus. Nam ullamcorper. Sed nisl lectus, pellentesque 
     114                nec, malesuada eget, ornare a, libero. Lorem ipsum dolor sit amet, 
     115                consectetuer adipiscing elit. 
     116        </div> 
     117 
    90118        <table style="border: solid blue 2px; margin-top: 1em;"> 
    91119                <tr> 
    92120                        <td> 
  • dijit/templates/TitlePane.html

     
    11<div class="dijitTitlePane"> 
    22        <div dojoAttachEvent="onclick:toggle,onkeypress: _onTitleKey,onfocus:_handleFocus,onblur:_handleFocus" tabindex="0" 
    3                         waiRole="button" class="dijitTitlePaneTitle" dojoAttachPoint="focusNode"> 
     3                        waiRole="button" class="dijitTitlePaneTitle" dojoAttachPoint="titleBarNode,focusNode"> 
    44                <div dojoAttachPoint="arrowNode" class="dijitInline dijitArrowNode"><span dojoAttachPoint="arrowNodeInner" class="dijitArrowNodeInner"></span></div> 
    55                <div dojoAttachPoint="titleNode" class="dijitTitlePaneTextNode"></div> 
    66        </div> 
  • dijit/TitlePane.js

     
    121121                // summary: set the open/close css state for the TitlePane 
    122122                var classes = ["dijitClosed", "dijitOpen"]; 
    123123                var boolIndex = this.open; 
    124                 dojo.removeClass(this.focusNode, classes[!boolIndex+0]); 
    125                 this.focusNode.className += " " + classes[boolIndex+0]; 
     124                dojo.removeClass(this.titleBarNode, classes[!boolIndex+0]); 
     125                this.titleBarNode.className += " " + classes[boolIndex+0]; 
    126126 
    127127                // provide a character based indicator for images-off mode 
    128128                this.arrowNodeInner.innerHTML = this.open ? "-" : "+";