mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-23 16:32:15 +00:00
Fixed for event items. Will probably fail tests because selenium can't type in simpleMDE :(
This commit is contained in:
@@ -36,6 +36,16 @@ function updatePrices() {
|
|||||||
$('#total').text(parseFloat(sum + vat).toFixed(2));
|
$('#total').text(parseFloat(sum + vat).toFixed(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setupMDE(selector) {
|
||||||
|
editor = new SimpleMDE({
|
||||||
|
element: $(selector)[0],
|
||||||
|
forceSync: true,
|
||||||
|
toolbar: ["bold", "italic", "strikethrough", "|", "unordered-list", "ordered-list", "|", "link", "|", "preview", "guide"],
|
||||||
|
status: true,
|
||||||
|
});
|
||||||
|
$(selector).data('mde_editor',editor);
|
||||||
|
}
|
||||||
|
|
||||||
$('#item-table').on('click', '.item-delete', function () {
|
$('#item-table').on('click', '.item-delete', function () {
|
||||||
delete objectitems[$(this).data('pk')]
|
delete objectitems[$(this).data('pk')]
|
||||||
$('#item-' + $(this).data('pk')).remove();
|
$('#item-' + $(this).data('pk')).remove();
|
||||||
|
|||||||
@@ -43,12 +43,14 @@
|
|||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
||||||
$(".md-enabled").each(function(index){
|
setupMDE('#id_description');
|
||||||
editor = new SimpleMDE({
|
setupMDE('#id_notes');
|
||||||
element: $(".md-enabled")[index],
|
setupMDE('#item_description');
|
||||||
toolbar: ["bold", "italic", "strikethrough", "|", "unordered-list", "ordered-list", "|", "link", "|", "preview", "guide"],
|
|
||||||
status: false,
|
$('#itemModal').on('shown.bs.modal', function (e) {
|
||||||
});
|
$('#item_description').data('mde_editor').value(
|
||||||
|
$('#item_description').val()
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
{% if not object.pk and not form.errors %}
|
{% if not object.pk and not form.errors %}
|
||||||
|
|||||||
Reference in New Issue
Block a user