Skip to content

Commit

Permalink
Remove Admin.set_object_field_value (#8231)
Browse files Browse the repository at this point in the history
  • Loading branch information
onEXHovia authored Dec 11, 2024
1 parent e16b48e commit 0136c32
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 31 deletions.
30 changes: 0 additions & 30 deletions assets/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const Admin = {
shared_setup(subject) {
Admin.read_config();
Admin.log('[core|shared_setup] Register services on', subject);
Admin.set_object_field_value(subject);
Admin.add_filters(subject);
Admin.setup_select2(subject);
Admin.setup_icheck(subject);
Expand Down Expand Up @@ -366,35 +365,6 @@ const Admin = {
updateCounter();
},

/**
* Change object field value
* @param subject
*/
set_object_field_value(subject) {
Admin.log('[core|set_object_field_value] set value field on', subject);

this.log(jQuery('a.sonata-ba-edit-inline', subject));
jQuery('a.sonata-ba-edit-inline', subject).on('click', (event) => {
Admin.stopEvent(event);
const element = jQuery(event.target);
jQuery.ajax({
url: element.attr('href'),
type: 'POST',
success: (response) => {
const elm = element.parent();
elm.children().remove();
// fix issue with html comment ...
elm.html(jQuery(response.replace(/<!--[\s\S]*?-->/g, '')).html());
elm.effect('highlight', { color: '#57A957' }, 2000);
Admin.set_object_field_value(elm);
},
error: () => {
element.parent().effect('highlight', { color: '#C43C35' }, 2000);
},
});
});
},

setup_collection_counter(subject) {
Admin.log('[core|setup_collection_counter] setup collection counter', subject);

Expand Down
2 changes: 1 addition & 1 deletion src/Resources/public/app.js

Large diffs are not rendered by default.

0 comments on commit 0136c32

Please sign in to comment.