mirror of
https://github.com/ha7ilm/openwebrx.git
synced 2026-04-05 06:25:19 +00:00
implement adding and removing scheduler slots
This commit is contained in:
parent
45a70a1079
commit
2785f43c6a
3 changed files with 93 additions and 49 deletions
|
|
@ -1,6 +1,8 @@
|
|||
$.fn.schedulerInput = function() {
|
||||
this.each(function() {
|
||||
var $container = $(this);
|
||||
var $template = $container.find('.template');
|
||||
$template.find('input, select').prop('disabled', true);
|
||||
|
||||
var update = function(value){
|
||||
$container.find('.option').hide();
|
||||
|
|
@ -13,5 +15,19 @@ $.fn.schedulerInput = function() {
|
|||
update(value);
|
||||
});
|
||||
update($select.val());
|
||||
|
||||
$container.find('.add-button').on('click', function() {
|
||||
var row = $template.clone();
|
||||
row.removeClass('template').show();
|
||||
row.find('input, select').prop('disabled', false);
|
||||
$template.before(row);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$container.on('click', '.remove-button', function(e) {
|
||||
var row = $(e.target).parents('.scheduler-static-time-inputs');
|
||||
row.remove();
|
||||
});
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue