forked from MapComplete/MapComplete
Add Tailwind button for save+cancel
- remove custom styles - add new button styles based on Tailwind classes using @apply - extend config to allow hover:ring-blue-200 and such - update the js-files to use new classes - Only unsure about the `.review-form .save-non-active`, this might need additional Tailwind helper classes in this specific situation. Don't know where it shows up, so could not test.
This commit is contained in:
parent
2342d369d0
commit
4068931bba
7 changed files with 29 additions and 39 deletions
|
@ -74,7 +74,7 @@ export default class EditableTagRendering extends UIElement {
|
|||
// And at last, set up the skip button
|
||||
const cancelbutton =
|
||||
Translations.t.general.cancel.Clone()
|
||||
.SetClass("cancel")
|
||||
.SetClass("btn btn-secondary mr-3")
|
||||
.onClick(() => {
|
||||
self._editMode.setData(false)
|
||||
});
|
||||
|
|
|
@ -33,7 +33,7 @@ export default class QuestionBox extends UIElement {
|
|||
self._skippedQuestions.ping();
|
||||
},
|
||||
Translations.t.general.skip.Clone()
|
||||
.SetClass("cancel")
|
||||
.SetClass("btn btn-secondary mr-3")
|
||||
.onClick(() => {
|
||||
self._skippedQuestions.data.push(i);
|
||||
self._skippedQuestions.ping();
|
||||
|
|
|
@ -22,15 +22,14 @@ export class SaveButton extends UIElement {
|
|||
}
|
||||
|
||||
InnerRender(): string {
|
||||
let clss = "save";
|
||||
|
||||
if(this._userDetails != undefined && !this._userDetails.data.loggedIn){
|
||||
return this._friendlyLogin.Render();
|
||||
}
|
||||
let inactive_class = ''
|
||||
if (this._value.data === false || (this._value.data ?? "") === "") {
|
||||
clss = "save-non-active";
|
||||
inactive_class = "btn-disabled";
|
||||
}
|
||||
return Translations.t.general.save.Clone().SetClass(clss).Render();
|
||||
return Translations.t.general.save.Clone().SetClass(`btn ${inactive_class}`).Render();
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue