Skip to content

Commit 92cc6b5

Browse files
author
Daniel Abercrombie
authored
Merge pull request #121 from dabercro/master
Split Radio Buttons
2 parents 7395ec7 + c616d51 commit 92cc6b5

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
},
2020
install_requires=[
2121
'cmstoolbox',
22+
'more-itertools<6.0.0',
2223
'cherrypy<18.0.0',
2324
'mako',
2425
'numpy>=1.6.1',

workflowwebtools/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
:author: Daniel Abercrombie <dabercro@mit.edu>
55
"""
66

7-
__version__ = '0.9.3'
7+
__version__ = '0.9.4'
88

99
__all__ = []

workflowwebtools/web/static/js/submit.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
var allHeader = "All Steps (use this or fill all others)";
22

33
function normalize (s) {
4-
return s.replace(/^_+/, "");
4+
return s.replace(/__\d*$/, ""). // Remove the counter for separating radios
5+
replace(/^_+/, ""); // Remove leading "_". Don't remember what those are from.
56
}
67

78
function printSiteLists (method, params) {
@@ -107,6 +108,8 @@ function makeTable (option, params) {
107108
else
108109
addParamTable().style.margin = "15px 0px 15px 0px";
109110

111+
counter = 0;
112+
110113
$(".paramtable").each(function () {
111114
var paramtable = this;
112115
option.opts.forEach(function (opt) {
@@ -117,7 +120,7 @@ function makeTable (option, params) {
117120
optDiv.appendChild(document.createTextNode(" " + value + " "));
118121
var radio = optDiv.appendChild(document.createElement("input"));
119122
radio.type = "radio";
120-
radio.name = opt.name;
123+
radio.name = opt.name + "__" + counter;
121124
radio.value = value;
122125
radio.ondblclick = function() {
123126
this.checked = false;
@@ -133,6 +136,9 @@ function makeTable (option, params) {
133136
input.type = "text";
134137
input.name = text;
135138
});
139+
140+
// Increment counter so that radio buttons are split
141+
counter++;
136142
});
137143
};
138144

0 commit comments

Comments
 (0)