- Issue created by @e.escribano
- Merge request !207Add 'lpb-component:delete.lpb', to the events that will trigger the addition... → (Open) created by e.escribano
When using frontend editing functionality, when adding, dragging, etc, the class "is_changed" is added to the wrapper of the paragraph. But when you delete a paragraph the class "is_changed" is not added.
Add a few paragraphs to a node and save.
Edit again and remove a paragraph and the class is not added.
The trigger that add "is_changed" are the following:
// Add class "is_changed" when the builder is edited.
const events = [
'lpb-component:insert.lpb',
'lpb-component:update.lpb',
'lpb-component:move.lpb',
'lpb-component:drop.lpb',
].join(' ');
$element.on(events, (e) => {
$(e.currentTarget).addClass('is_changed');
});
Add to the const events the delete one:
// Add class "is_changed" when the builder is edited.
const events = [
'lpb-component:insert.lpb',
'lpb-component:update.lpb',
'lpb-component:move.lpb',
'lpb-component:drop.lpb',
'lpb-component:delete.lpb',
].join(' ');
$element.on(events, (e) => {
$(e.currentTarget).addClass('is_changed');
});
Active
2.1
Code