Changeset 15139

Show
Ignore:
Timestamp:
09/05/08 02:11:00 (3 months ago)
Author:
bill
Message:

Change InlineEditBox? to use <span> instead of <fieldset>, to workaround
IE bugs (?) setting innerHTML for the button labels.
Fixes #7593 !strict.

Also added some button tests.

Location:
dijit/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • dijit/trunk/templates/InlineEditBox.html

    r14283 r15139  
    1 <fieldset dojoAttachPoint="editNode" waiRole="presentation" style="position: absolute; visibility:hidden" class="dijitReset dijitInline" 
     1<span dojoAttachPoint="editNode" waiRole="presentation" style="position: absolute; visibility:hidden" class="dijitReset dijitInline" 
    22        dojoAttachEvent="onkeypress: _onKeyPress"  
    3         ><div dojoAttachPoint="editorPlaceholder"></div 
     3        ><span dojoAttachPoint="editorPlaceholder"></span 
    44        ><span dojoAttachPoint="buttonContainer" 
    5                 ><button class='saveButton' dojoAttachPoint="saveButton" dojoType="dijit.form.Button" dojoAttachEvent="onClick:save" disabled="true">${buttonSave}</button 
    6                 ><button class='cancelButton' dojoAttachPoint="cancelButton" dojoType="dijit.form.Button" dojoAttachEvent="onClick:cancel">${buttonCancel}</button 
     5                ><button class='saveButton' dojoAttachPoint="saveButton" dojoType="dijit.form.Button" dojoAttachEvent="onClick:save" disabled="true" label="${buttonSave}"></button 
     6                ><button class='cancelButton' dojoAttachPoint="cancelButton" dojoType="dijit.form.Button" dojoAttachEvent="onClick:cancel" label="${buttonCancel}"></button 
    77        ></span 
    8 ></fieldset> 
     8></span> 
  • dijit/trunk/tests/form/test_Button.html

    r15099 r15139  
    246246                        }); 
    247247                } 
     248                function getLabels(){ 
     249                        forEachButton(function(widget){ 
     250                                console.log(widget.attr('label')); 
     251                        }); 
     252                } 
    248253        </script> 
    249254        <div> 
    250255                <button id="toggle" onclick='toggleDisabled()'>Disable all</button> 
    251256                <button onclick='changeLabels()'>Change labels</button> 
     257                <button onclick='getLabels()'>Get labels</button> 
    252258                <button onclick='location.reload()'>Revert</button> 
    253259        </div> 
    254260        <h3>Button instantiated via javacript:</h3> 
    255         <div id="buttonContainer"></div> 
     261        <p id="buttonContainer" style="display: none;"></p> 
    256262        <script type="text/javascript"> 
    257263                // See if we can make a button in script and attach it to the DOM ourselves. 
    258264                dojo.addOnLoad(function(){ 
    259                         var params = { 
     265                        var widget = new dijit.form.Button({ 
    260266                                label: "hello!", 
    261267                                name: "programmatic" 
    262                         }; 
    263                         var widget = new dijit.form.Button(params, "buttonContainer"); 
     268                        }); 
     269                        widget.placeAt("buttonContainer");      // place in page 
     270 
     271                        var widget2 = new dijit.form.Button({ 
     272                                label: "hello!", 
     273                                name: "programmatic" 
     274                        }); 
     275                        widget2.attr("label", "i'm programmatic too");  // change label (for testing) 
     276                        widget2.placeAt("buttonContainer");     // place in page 
    264277                }); 
    265278        </script>