apply type="button" on all buttons to make submit on enter work

This commit is contained in:
Jakob Ketterl 2021-03-03 23:25:00 +01:00
parent 3814200452
commit 4e14b29537
8 changed files with 13 additions and 13 deletions

View File

@ -79,8 +79,8 @@ $.fn.bookmarktable = function() {
} else { } else {
cell.html( cell.html(
'<div class="btn-group btn-group-sm">' + '<div class="btn-group btn-group-sm">' +
'<button class="btn btn-primary bookmark-save">Save</button>' + '<button type="button" class="btn btn-primary bookmark-save">Save</button>' +
'<button class="btn btn-secondary bookmark-cancel">Cancel</button>' + '<button type="button" class="btn btn-secondary bookmark-cancel">Cancel</button>' +
'</div>' '</div>'
); );
} }

View File

@ -5,7 +5,7 @@ $.fn.wsjtDecodingDepthsInput = function() {
this.modeInput.val(mode); this.modeInput.val(mode);
this.valueInput = $(inputs.get(1)).clone(); this.valueInput = $(inputs.get(1)).clone();
this.valueInput.val(value); this.valueInput.val(value);
this.removeButton = $('<button class="btn btn-sm btn-danger remove">Remove</button>'); this.removeButton = $('<button type="button" class="btn btn-sm btn-danger remove">Remove</button>');
this.removeButton.data('row', this); this.removeButton.data('row', this);
this.el.append([this.modeInput, this.valueInput, this.removeButton].map(function(i) { this.el.append([this.modeInput, this.valueInput, this.removeButton].map(function(i) {
return $('<td>').append(i); return $('<td>').append(i);
@ -46,7 +46,7 @@ $.fn.wsjtDecodingDepthsInput = function() {
$table.on('change', updateValue); $table.on('change', updateValue);
$el.append($table); $el.append($table);
var $addButton = $('<button class="btn btn-sm btn-primary">Add...</button>'); var $addButton = $('<button type="button" class="btn btn-sm btn-primary">Add...</button>');
$addButton.on('click', function() { $addButton.on('click', function() {
var row = new WsjtDecodingDepthRow(inputs) var row = new WsjtDecodingDepthRow(inputs)

View File

@ -20,7 +20,7 @@ ${header}
<div class="bookmarks"> <div class="bookmarks">
${bookmarks} ${bookmarks}
<div class="buttons container"> <div class="buttons container">
<button class="btn btn-primary bookmark-add">Add a new bookmark</button> <button type="button" class="btn btn-primary bookmark-add">Add a new bookmark</button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -55,7 +55,7 @@ class BookmarksController(AuthorizationMixin, WebpageController):
<td class="frequency">{frequency}</td> <td class="frequency">{frequency}</td>
<td data-value="{modulation}">{modulation_name}</td> <td data-value="{modulation}">{modulation_name}</td>
<td> <td>
<button class="btn btn-sm btn-danger bookmark-delete">delete</button> <button type="button" class="btn btn-sm btn-danger bookmark-delete">delete</button>
</td> </td>
</tr> </tr>
""".format( """.format(

View File

@ -42,7 +42,7 @@ class Input(ABC):
input=input, input=input,
infotext=infotext, infotext=infotext,
removable="removable" if self.removable else "", removable="removable" if self.removable else "",
removebutton='<button class="btn btn-sm btn-danger option-remove-button">Remove</button>' removebutton='<button type="button" class="btn btn-sm btn-danger option-remove-button">Remove</button>'
if self.removable if self.removable
else "", else "",
) )

View File

@ -227,7 +227,7 @@ class SchedulerInput(Input):
<div class="row scheduler-static-time-inputs"> <div class="row scheduler-static-time-inputs">
{time_inputs} {time_inputs}
{select} {select}
<button class="btn btn-sm btn-danger remove-button">X</button> <button type="button" class="btn btn-sm btn-danger remove-button">X</button>
</div> </div>
""".format( """.format(
time_inputs=render_time_inputs(slot), time_inputs=render_time_inputs(slot),
@ -241,10 +241,10 @@ class SchedulerInput(Input):
<div class="row scheduler-static-time-inputs template" style="display: none;"> <div class="row scheduler-static-time-inputs template" style="display: none;">
{time_inputs} {time_inputs}
{select} {select}
<button class="btn btn-sm btn-danger remove-button">X</button> <button type="button" class="btn btn-sm btn-danger remove-button">X</button>
</div> </div>
<div class="row"> <div class="row">
<button class="btn btn-sm btn-primary col-12 add-button">Add...</button> <button type="button" class="btn btn-sm btn-primary col-12 add-button">Add...</button>
</div> </div>
""".format( """.format(
rows=rows, rows=rows,

View File

@ -11,8 +11,8 @@ class ImageInput(Input, metaclass=ABCMeta):
<div class="image-container"> <div class="image-container">
<img class="{classes}" src="{url}" alt="{label}"/> <img class="{classes}" src="{url}" alt="{label}"/>
</div> </div>
<button class="btn btn-primary upload">Upload new image...</button> <button type="button" class="btn btn-primary upload">Upload new image...</button>
<button class="btn btn-secondary restore">Restore original image</button> <button type="button" class="btn btn-secondary restore">Restore original image</button>
</div> </div>
""".format( """.format(
id=self.id, label=self.label, url=self.cachebuster(self.getUrl()), classes=" ".join(self.getImgClasses()) id=self.id, label=self.label, url=self.cachebuster(self.getUrl()), classes=" ".join(self.getImgClasses())

View File

@ -415,7 +415,7 @@ class OptionalSection(Section):
{options} {options}
</select> </select>
<div class="input-group-append"> <div class="input-group-append">
<button class="btn btn-success option-add-button">Add</button> <button type="button" class="btn btn-success option-add-button">Add</button>
</div> </div>
</div> </div>
</div> </div>