Skip to content

Commit

Permalink
IBX-6078: Added Revert to saved button (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszdebinski authored Aug 22, 2023
1 parent f0c61c1 commit 88f4447
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ class IbexaAttributesUI extends Plugin {
this.hideForm();
});

this.listenTo(formView, 'revert-custom-attributes', () => {
this.hideForm();
});

return formView;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class IbexaCustomAttributesFormView extends View {

this.saveButtonView = this.createButton('Save', null, 'ck-button-save', 'save-custom-attributes');
this.cancelButtonView = this.createButton('Remove', null, 'ck-button-cancel', 'remove-custom-attributes');
this.revertButtonView = this.createButton('Revert to saved', null, 'ck-button-revert', 'revert-custom-attributes');

this.attributeViews = {};
this.classesView = null;
Expand Down Expand Up @@ -71,7 +72,7 @@ class IbexaCustomAttributesFormView extends View {
attributes: {
class: 'ibexa-ckeditor-balloon-form__actions',
},
children: [this.saveButtonView, this.cancelButtonView],
children: [this.saveButtonView, this.revertButtonView, this.cancelButtonView],
},
],
},
Expand Down
5 changes: 5 additions & 0 deletions src/bundle/Resources/public/scss/_balloon-form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@
}
}

&.ck-button-revert {
margin-right: calculateRem(8px);
}

&.ck-button-cancel,
&.ck-button-revert,
&.ibexa-btn--select-content {
color: $ibexa-color-primary;
fill: $ibexa-color-primary;
Expand Down

0 comments on commit 88f4447

Please sign in to comment.