| 1 |
define([ |
| 2 |
"dojo/_base/declare", |
| 3 |
"dojo/dom-construct", |
| 4 |
"./Pane", |
| 5 |
"./iconUtils", |
| 6 |
"./sniff" |
| 7 |
], function(declare, domConstruct, Pane, iconUtils, has){ |
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
return declare("dojox.mobile._IconItemPane", Pane, { |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
iconPos: "", |
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
closeIconRole: "", |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
closeIconTitle: "", |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
label: "", |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
closeIcon: "mblDomButtonBlueMinus", |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
baseClass: "mblIconItemPane", |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
tabIndex: "0", |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
_setTabIndexAttr: "closeIconNode", |
| 48 |
|
| 49 |
buildRendering: function(){ |
| 50 |
this.inherited(arguments); |
| 51 |
this.hide(); |
| 52 |
this.closeHeaderNode = domConstruct.create("h2", {className:"mblIconItemPaneHeading"}, this.domNode); |
| 53 |
this.closeIconNode = domConstruct.create("div", { |
| 54 |
className: "mblIconItemPaneIcon", |
| 55 |
role: this.closeIconRole, |
| 56 |
title: this.closeIconTitle |
| 57 |
}, this.closeHeaderNode); |
| 58 |
this.labelNode = domConstruct.create("span", {className:"mblIconItemPaneTitle"}, this.closeHeaderNode); |
| 59 |
this.containerNode = domConstruct.create("div", {className:"mblContent"}, this.domNode); |
| 60 |
}, |
| 61 |
|
| 62 |
show: function(){ |
| 63 |
|
| 64 |
|
| 65 |
this.domNode.style.display = ""; |
| 66 |
}, |
| 67 |
|
| 68 |
hide: function(){ |
| 69 |
|
| 70 |
|
| 71 |
this.domNode.style.display = "none"; |
| 72 |
}, |
| 73 |
|
| 74 |
isOpen: function(e){ |
| 75 |
|
| 76 |
|
| 77 |
return this.domNode.style.display !== "none"; |
| 78 |
}, |
| 79 |
|
| 80 |
_setLabelAttr: function(text){ |
| 81 |
|
| 82 |
|
| 83 |
this._set("label", text); |
| 84 |
this.labelNode.innerHTML = this._cv ? this._cv(text) : text; |
| 85 |
}, |
| 86 |
|
| 87 |
_setCloseIconAttr: function(icon){ |
| 88 |
|
| 89 |
|
| 90 |
this._set("closeIcon", icon); |
| 91 |
this.closeIconNode = iconUtils.setIcon(icon, this.iconPos, this.closeIconNode, null, this.closeHeaderNode); |
| 92 |
|
| 93 |
if(has("windows-theme") && this.closeIconTitle !== ""){ |
| 94 |
this.closeButtonNode = domConstruct.create("span", {className:"mblButton mblCloseButton", innerHTML:this.closeIconTitle, |
| 95 |
style: {display: "none"}}, this.closeIconNode); |
| 96 |
} |
| 97 |
} |
| 98 |
}); |
| 99 |
}); |