加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Fieldset.js 1.01 KB
一键复制 编辑 原始数据 按行查看 历史
define([
"dojo/_base/declare",
"dojo/query!css2",
"dijit/TitlePane",
"dojo/text!./templates/Fieldset.html",
"./a11yclick" // template uses ondijitclick
], function(declare, query, TitlePane, template){
return declare("dijit.Fieldset", TitlePane, {
// summary:
// An accessible fieldset that can be expanded or collapsed via
// its legend. Fieldset extends `dijit.TitlePane`.
// baseClass: [protected] String
// The root className to use for the various states of this widget
baseClass: 'dijitFieldset',
// title: String
// Content of the legend tag. Overrides <legend> tag if not empty.
title: '',
// open: Boolean
// Whether fieldset is opened or closed.
open: true,
templateString: template,
postCreate: function() {
if(!this.title){
var legends = query('legend', this.containerNode);
if(legends.length) { // oops, no legend?
this.set('title', legends[0].innerHTML);
legends[0].parentNode.removeChild(legends[0]);
}
}
this.inherited(arguments);
}
});
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化