Changeset 14510
- Timestamp:
- 07/18/08 11:04:30 (4 months ago)
- Location:
- dijit/trunk
- Files:
-
- 2 modified
-
form/Button.js (modified) (2 diffs)
-
tests/form/test_Button.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
dijit/trunk/form/Button.js
r14272 r14510 68 68 // get label and set as title on button icon if necessary 69 69 if (this.showLabel == false){ 70 var labelText = "";71 70 this.label = this.containerNode.innerHTML; 72 labelText = dojo.trim(this.containerNode.innerText || this.containerNode.textContent || ''); 73 // set title attrib on iconNode 74 this.titleNode.title=labelText; 71 // if no title provided, set title attrib on iconNode 72 if(!dojo.attr(this.domNode, "title")){ 73 this.titleNode.title=dojo.trim(this.containerNode.innerText || this.containerNode.textContent || ''); 74 } 75 75 dojo.addClass(this.containerNode,"dijitDisplayNone"); 76 76 } … … 93 93 this.containerNode.innerHTML = this.label = content; 94 94 this._layoutHack(); 95 if (this.showLabel == false ){95 if (this.showLabel == false && !(dojo.attr(this.domNode, "title"))){ 96 96 this.titleNode.title=dojo.trim(this.containerNode.innerText || this.containerNode.textContent || ''); 97 97 } -
dijit/trunk/tests/form/test_Button.html
r13943 r14510 98 98 <br clear="all"> 99 99 <h2>Buttons with no text label</h2> 100 <p>Buttons have showLabel=false so text is not displayed. Should havetitle attribute displayed on mouse over</p>101 <div class="box"> 102 <button id="1466" dojoType="dijit.form.Button" onClick='console.log("clicked simple button with no text label")'100 <p>Buttons have showLabel=false so text is not displayed. If no title attribute supplied, Should have label as title attribute displayed on mouse over</p> 101 <div class="box"> 102 <button id="1466" dojoType="dijit.form.Button" title="title attrib rather than label" onClick='console.log("clicked simple button with no text label")' 103 103 iconClass="plusIcon" showLabel="false"> 104 104 <span><b>Rich</b><i> Text</i> Test!</span>