mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-09 01:49:35 -06:00
Fixes #20245: Fix Markdown preview functionality within "quick add" modal
This commit is contained in:
parent
9e75a2f955
commit
d222466882
@ -238,7 +238,8 @@ class ObjectEditView(GetReturnURLMixin, BaseObjectView):
|
||||
model = self.queryset.model
|
||||
|
||||
initial_data = normalize_querydict(request.GET)
|
||||
form = self.form(instance=obj, initial=initial_data)
|
||||
form_prefix = 'quickadd' if request.GET.get('_quickadd') else None
|
||||
form = self.form(instance=obj, initial=initial_data, prefix=form_prefix)
|
||||
restrict_form_fields(form, request.user)
|
||||
|
||||
context = {
|
||||
|
||||
BIN
netbox/project-static/dist/netbox.js
vendored
BIN
netbox/project-static/dist/netbox.js
vendored
Binary file not shown.
BIN
netbox/project-static/dist/netbox.js.map
vendored
BIN
netbox/project-static/dist/netbox.js.map
vendored
Binary file not shown.
@ -1,5 +1,3 @@
|
||||
import { isTruthy } from 'src/util';
|
||||
|
||||
/**
|
||||
* interface for htmx configRequest event
|
||||
*/
|
||||
@ -17,15 +15,6 @@ function initMarkdownPreview(markdownWidget: HTMLDivElement) {
|
||||
const textarea = markdownWidget.querySelector('textarea') as HTMLTextAreaElement;
|
||||
const preview = markdownWidget.querySelector('div.preview') as HTMLDivElement;
|
||||
|
||||
/**
|
||||
* Make sure the textarea has style attribute height
|
||||
* So that it can be copied over to preview div.
|
||||
*/
|
||||
if (!isTruthy(textarea.style.height)) {
|
||||
const { height } = textarea.getBoundingClientRect();
|
||||
textarea.style.height = `${height}px`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the value of the textarea to the body of the htmx request
|
||||
* and copy the height of text are to the preview div
|
||||
|
||||
Loading…
Reference in New Issue
Block a user