Remove condition for non-nested case
We don't use these input fields inside a non-nested context since commit
2993ef870.
This commit is contained in:
@@ -76,7 +76,6 @@
|
||||
buildData: function(data, input) {
|
||||
var wrapper;
|
||||
wrapper = $(input).closest(".direct-upload");
|
||||
data.input = input;
|
||||
data.wrapper = wrapper;
|
||||
data.progressBar = $(wrapper).find(".progress-bar-placeholder");
|
||||
data.errorContainer = $(wrapper).find(".attachment-errors");
|
||||
@@ -133,11 +132,7 @@
|
||||
},
|
||||
complete: function() {
|
||||
App.Documentable.unlockUploads();
|
||||
if ($(data.input).data("nested-document") === true) {
|
||||
$(data.wrapper).remove();
|
||||
} else {
|
||||
$(data.wrapper).find("a.remove-cached-attachment").remove();
|
||||
}
|
||||
$(data.wrapper).remove();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@@ -72,7 +72,6 @@
|
||||
buildData: function(data, input) {
|
||||
var wrapper;
|
||||
wrapper = $(input).closest(".direct-upload");
|
||||
data.input = input;
|
||||
data.wrapper = wrapper;
|
||||
data.progressBar = $(wrapper).find(".progress-bar-placeholder");
|
||||
data.preview = $(wrapper).find(".image-preview");
|
||||
@@ -133,11 +132,7 @@
|
||||
},
|
||||
complete: function() {
|
||||
$("#new_image_link").removeClass("hide");
|
||||
if ($(data.input).data("nested-image") === true) {
|
||||
$(data.wrapper).remove();
|
||||
} else {
|
||||
$(data.wrapper).find("a.remove-cached-attachment").remove();
|
||||
}
|
||||
$(data.wrapper).remove();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@@ -39,10 +39,7 @@ class Documents::FieldsComponent < ApplicationComponent
|
||||
label_options: { class: "button hollow #{klass}" },
|
||||
accept: accepted_content_types_extensions,
|
||||
class: "js-document-attachment",
|
||||
data: {
|
||||
url: direct_upload_path,
|
||||
nested_document: true
|
||||
}
|
||||
data: { url: direct_upload_path }
|
||||
end
|
||||
|
||||
def direct_upload_path
|
||||
|
||||
@@ -40,10 +40,7 @@ class Images::FieldsComponent < ApplicationComponent
|
||||
label_options: { class: "button hollow #{klass}" },
|
||||
accept: accepted_content_types_extensions,
|
||||
class: "js-image-attachment",
|
||||
data: {
|
||||
url: direct_upload_path,
|
||||
nested_image: true
|
||||
}
|
||||
data: { url: direct_upload_path }
|
||||
end
|
||||
|
||||
def direct_upload_path
|
||||
|
||||
Reference in New Issue
Block a user