mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-25 10:29:14 -04:00
Add a form to set priority of top 2 providers
Their priority should always add up to 100%. Currently we have to ensure this by hand. Adding this form means there’s no way to not set their combined priorities to 100%. And it’s a bit more of an intuitive UI than two textboxes on separate pages.
This commit is contained in:
26
app/assets/javascripts/radioSlider.js
Normal file
26
app/assets/javascripts/radioSlider.js
Normal file
@@ -0,0 +1,26 @@
|
||||
(function(global) {
|
||||
|
||||
"use strict";
|
||||
|
||||
global.GOVUK.Modules.RadioSlider = function() {
|
||||
|
||||
this.start = function(component) {
|
||||
|
||||
$(component)
|
||||
.on('click', function() {
|
||||
|
||||
leftRight = $(this).find(':checked').next('label').text().split('/');
|
||||
|
||||
if (leftRight.length === 2) {
|
||||
$(this).find('.radio-slider-left-value').html(leftRight[0]);
|
||||
$(this).find('.radio-slider-right-value').html(leftRight[1]);
|
||||
}
|
||||
|
||||
})
|
||||
.trigger('click');
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
})(window);
|
||||
Reference in New Issue
Block a user