Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/maniphest/behavior-batch-selector.js
| Show First 20 Lines • Show All 151 Lines • ▼ Show 20 Lines | JX.behavior('maniphest-batch-selector', function(config) { | ||||
| // When the user submits the form, dump selected state into it. | // When the user submits the form, dump selected state into it. | ||||
| JX.DOM.listen( | JX.DOM.listen( | ||||
| JX.$(config.formID), | JX.$(config.formID), | ||||
| 'submit', | 'submit', | ||||
| null, | null, | ||||
| function() { | function() { | ||||
| var inputs = []; | var ids = []; | ||||
| for (var k in selected) { | for (var k in selected) { | ||||
| inputs.push( | ids.push(k); | ||||
| JX.$N('input', {type: 'hidden', name: 'batch[]', value: k})); | |||||
| } | } | ||||
| JX.DOM.setContent(JX.$(config.idContainer), inputs); | ids = ids.join(','); | ||||
| var input = JX.$N('input', {type: 'hidden', name: 'ids', value: ids}); | |||||
| JX.DOM.setContent(JX.$(config.idContainer), input); | |||||
| }); | }); | ||||
| update(); | update(); | ||||
| }); | }); | ||||