source: Dev/trunk/src/client/dojox/mobile/RoundRectCategory.js

Last change on this file was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

File size: 1.6 KB
Line 
1define([
2        "dojo/_base/declare",
3        "dojo/_base/window",
4        "dojo/dom-construct",
5        "dijit/_Contained",
6        "dijit/_WidgetBase",
7        "dojo/has",
8        "dojo/has!dojo-bidi?dojox/mobile/bidi/RoundRectCategory"
9], function(declare, win, domConstruct, Contained, WidgetBase, has, BidiRoundRectCategory){
10
11        // module:
12        //              dojox/mobile/RoundRectCategory
13
14        var RoundRectCategory = declare(has("dojo-bidi") ? "dojox.mobile.NonBidiRoundRectCategory" : "dojox.mobile.RoundRectCategory", [WidgetBase, Contained], {
15                // summary:
16                //              A category header for a rounded rectangle list.
17
18                // label: String
19                //              A label of the category. If the label is not specified,
20                //              innerHTML is used as a label.
21                label: "",
22
23                // tag: String
24                //              A name of html tag to create as domNode.
25                tag: "h2",
26
27                /* internal properties */       
28               
29                // baseClass: String
30                //              The name of the CSS class of this widget.
31                baseClass: "mblRoundRectCategory",
32
33                buildRendering: function(){
34                        var domNode = this.domNode = this.containerNode = this.srcNodeRef || domConstruct.create(this.tag);
35                        this.inherited(arguments);
36                        if(!this.label && domNode.childNodes.length === 1 && domNode.firstChild.nodeType === 3){
37                                // if it has only one text node, regard it as a label
38                                this.label = domNode.firstChild.nodeValue;
39                        }
40                },
41
42                _setLabelAttr: function(/*String*/label){
43                        // summary:
44                        //              Sets the category header text.
45                        // tags:
46                        //              private
47                        this.label = label;
48                        this.domNode.innerHTML = this._cv ? this._cv(label) : label;
49                }
50        });
51
52        return has("dojo-bidi") ? declare("dojox.mobile.RoundRectCategory", [RoundRectCategory, BidiRoundRectCategory]) : RoundRectCategory;   
53});
Note: See TracBrowser for help on using the repository browser.