Skip to content

Commit

Permalink
Merge pull request #502 from qor5/fix-updateConfirm
Browse files Browse the repository at this point in the history
fix doupdate use confirm script
  • Loading branch information
zhangshanwen authored Aug 21, 2024
2 parents 306c4a6 + ca0f95a commit 594e79c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion presets/detailing.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ func (b *DetailingBuilder) showInDrawer(ctx *web.EventContext) (r web.EventRespo
onChangeEvent := fmt.Sprintf("if (vars.%s) { vars.%s.detailing=true };", VarsPresetsDataChanged, VarsPresetsDataChanged)

overlayType := ctx.R.FormValue(ParamOverlay)
closeBtnVarScript := CloseRightDrawerVarScript
closeBtnVarScript := CloseRightDrawerVarConfirmScript
style := DetailingStyleDrawer
if overlayType == actions.Dialog {
closeBtnVarScript = CloseDialogVarScript
Expand Down
2 changes: 1 addition & 1 deletion presets/editing.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ func (b *EditingBuilder) editFormFor(obj interface{}, ctx *web.EventContext) h.H
sidePanel: b.sidePanel,
}, obj, ctx)

closeBtnVarScript := CloseRightDrawerVarScript
closeBtnVarScript := CloseRightDrawerVarConfirmScript
if overlayType == actions.Dialog {
closeBtnVarScript = CloseDialogVarScript
}
Expand Down
3 changes: 2 additions & 1 deletion presets/presets.go
Original file line number Diff line number Diff line change
Expand Up @@ -824,10 +824,11 @@ const (
)

var (
CloseRightDrawerVarScript = ConfirmLeaveScript("vars.confirmDrawerLeave=true;", "vars.presetsRightDrawer = false;")
CloseRightDrawerVarConfirmScript = ConfirmLeaveScript("vars.confirmDrawerLeave=true;", "vars.presetsRightDrawer = false;")
)

const (
CloseRightDrawerVarScript = "vars.presetsRightDrawer = false"
CloseDialogVarScript = "vars.presetsDialog = false"
CloseListingDialogVarScript = "vars.presetsListingDialog = false"
)
Expand Down
2 changes: 1 addition & 1 deletion publish/version_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func NewListenerVersionSelected(evCtx *web.EventContext, mb *presets.ModelBuilde
`,
slug,
strings.Join([]string{
presets.CloseRightDrawerVarScript,
presets.CloseRightDrawerVarConfirmScript,
drawerToSlug.Go(),
}, ";"),
web.Plaid().PushState(true).URL(web.Var(fmt.Sprintf(`%q + "/" + payload.slug`, mb.Info().ListingHref()))).Go(),
Expand Down

0 comments on commit 594e79c

Please sign in to comment.