Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion netbox/netbox/views/generic/object_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ def get(self, request, *args, **kwargs):
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 = {
Expand Down
6 changes: 3 additions & 3 deletions netbox/project-static/dist/netbox.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions netbox/project-static/dist/netbox.js.map

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions netbox/project-static/src/buttons/markdownPreview.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { isTruthy } from 'src/util';

/**
* interface for htmx configRequest event
*/
Expand All @@ -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
Expand Down