mirror of
				https://github.com/Jermolene/TiddlyWiki5
				synced 2025-10-31 15:42:59 +00:00 
			
		
		
		
	Merge pull request #1465 from roma0104/master
Added Class Mechanism to Checkbox Widget
This commit is contained in:
		| @@ -35,6 +35,7 @@ CheckboxWidget.prototype.render = function(parent,nextSibling) { | |||||||
| 	this.execute(); | 	this.execute(); | ||||||
| 	// Create our elements | 	// Create our elements | ||||||
| 	this.labelDomNode = this.document.createElement("label"); | 	this.labelDomNode = this.document.createElement("label"); | ||||||
|  | 	this.labelDomNode.setAttribute("class",this.checkboxClass); | ||||||
| 	this.inputDomNode = this.document.createElement("input"); | 	this.inputDomNode = this.document.createElement("input"); | ||||||
| 	this.inputDomNode.setAttribute("type","checkbox"); | 	this.inputDomNode.setAttribute("type","checkbox"); | ||||||
| 	if(this.getValue()) { | 	if(this.getValue()) { | ||||||
| @@ -126,6 +127,7 @@ CheckboxWidget.prototype.execute = function() { | |||||||
| 	this.checkboxChecked = this.getAttribute("checked"); | 	this.checkboxChecked = this.getAttribute("checked"); | ||||||
| 	this.checkboxUnchecked = this.getAttribute("unchecked"); | 	this.checkboxUnchecked = this.getAttribute("unchecked"); | ||||||
| 	this.checkboxDefault = this.getAttribute("default"); | 	this.checkboxDefault = this.getAttribute("default"); | ||||||
|  | 	this.checkboxClass = this.getAttribute("class",""); | ||||||
| 	// Make the child widgets | 	// Make the child widgets | ||||||
| 	this.makeChildWidgets(); | 	this.makeChildWidgets(); | ||||||
| }; | }; | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| title: CheckboxWidget | title: CheckboxWidget | ||||||
| created: 201310241419 | created: 201310241419 | ||||||
| modified: 201407110837 | modified: 201502050050 | ||||||
| tags: Widgets | tags: Widgets | ||||||
| caption: checkbox | caption: checkbox | ||||||
|  |  | ||||||
| @@ -22,6 +22,7 @@ The content of the `<$checkbox>` widget is displayed within an HTML `<label>` el | |||||||
| |checked |The value of the field corresponding to the checkbox being checked | | |checked |The value of the field corresponding to the checkbox being checked | | ||||||
| |unchecked |The value of the field corresponding to the checkbox being unchecked | | |unchecked |The value of the field corresponding to the checkbox being unchecked | | ||||||
| |default |The default value to use if the field is not defined | | |default |The default value to use if the field is not defined | | ||||||
|  | |class |The class that will be assigned to the label element | | ||||||
|  |  | ||||||
| !! Tag Mode | !! Tag Mode | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jeremy Ruston
					Jeremy Ruston