-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix tomselect layout bug in accordions
- Loading branch information
1 parent
de68522
commit 7db4b45
Showing
6 changed files
with
105 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
$('#newAssignmentButton').hide(); | ||
|
||
$('#assignmentListHeader').show() | ||
.after('<%= j render partial: "assignments/form", locals: { assignment: @assignment } %>'); | ||
|
||
new TomSelect('#assignment_medium_id_', { | ||
sortField: { | ||
field: 'text', | ||
direction: 'asc' | ||
}, | ||
dropdownParent: document.body, | ||
onInitialize:function(){ | ||
this.popper = Popper.createPopper(this.control,this.dropdown, { | ||
placement: "bottom-start", | ||
modifiers: [ | ||
{ | ||
name: "sameWidth", | ||
enabled: true, | ||
fn: ({ state }) => { | ||
state.styles.popper.width = `${state.rects.reference.width}px`; | ||
}, | ||
phase: "beforeWrite", | ||
requires: ["computeStyles"], | ||
} | ||
] | ||
|
||
}); | ||
}, | ||
onDropdownOpen:function(){ | ||
this.popper.update(); | ||
}, | ||
render: { | ||
no_results: function(data, escape) { | ||
return '<div class="no-results"><%= t("basics.no_results") %></div>'; | ||
} | ||
} | ||
}); | ||
|
||
$('#assignment_medium_id_').val(null).trigger('change'); | ||
|
||
$("#assignment_deadline_").datetimepicker({ | ||
format: 'd.m.Y H:i', | ||
inline: false | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ | |
</script> | ||
<link href="https://cdn.jsdelivr.net/npm/tom-select/dist/css/tom-select.default.min.css" rel="stylesheet"> | ||
<script src="https://cdn.jsdelivr.net/npm/tom-select/dist/js/tom-select.complete.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script> | ||
<!--[if lt IE 9]> | ||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/r29/html5.min.js"> | ||
</script> | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
$('.submission-actions[data-id="<%= @submission.id %>"]').empty() | ||
.append('<%= j render partial: "submissions/select_tutorial", | ||
locals: { submission: @submission, | ||
lecture: @lecture, | ||
tutorial: @tutorial } %>'); | ||
|
||
new TomSelect('#submission_tutorial_id-<%= @submission.id %>', { | ||
sortField: { | ||
field: 'text', | ||
direction: 'asc' | ||
}, | ||
dropdownParent: document.body, | ||
onInitialize:function(){ | ||
this.popper = Popper.createPopper(this.control,this.dropdown, { | ||
placement: "bottom-start", | ||
modifiers: [ | ||
{ | ||
name: "sameWidth", | ||
enabled: true, | ||
fn: ({ state }) => { | ||
state.styles.popper.width = `${state.rects.reference.width}px`; | ||
}, | ||
phase: "beforeWrite", | ||
requires: ["computeStyles"], | ||
} | ||
] | ||
|
||
}); | ||
}, | ||
onDropdownOpen:function(){ | ||
this.popper.update(); | ||
}, | ||
render: { | ||
no_results: function(data, escape) { | ||
return '<div class="no-results"><%= t("basics.no_results") %></div>'; | ||
} | ||
} | ||
}); |