Bugzilla – Attachment 160936 Details for
Bug 35062
Allow a framework plugin to add class to prevent submit during ajax call
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35062: Add class plugin-blocks-submit in addbiblio
Bug-35062-Add-class-plugin-blocks-submit-in-addbib.patch (text/plain), 1.83 KB, created by
Kyle M Hall (khall)
on 2024-01-12 11:43:01 UTC
(
hide
)
Description:
Bug 35062: Add class plugin-blocks-submit in addbiblio
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2024-01-12 11:43:01 UTC
Size:
1.83 KB
patch
obsolete
>From f98e8bf50ad442ac47d62f0554f21a5083409e3a Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 16 Oct 2023 12:08:25 +0200 >Subject: [PATCH] Bug 35062: Add class plugin-blocks-submit in addbiblio > >Adding this condition in Check() allows you to prevent form submittal >during e.g. an ajax call in a framework plugin. >The plugin adds and removes the class on the corresponding html >element during processing. > >Test plan: >Since we do not have a plugin using this class yet, nothing changes now. >Verify that you can still click Save in addbiblio while using standard >plugins. In other words: no change in behavior. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > .../intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >index 3f09598fa10..85a4eb36a1d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >@@ -744,7 +744,10 @@ $(document).ready(function(){ > function Check(){ > var StrAlert = AreFieldsNotOk(); > var StrWarning = AreFieldsNotOk( false ); >- if( !StrAlert && StrWarning ){ >+ if ( $('.plugin-blocks-submit').length > 0 ) { >+ // This class can be set by framework plugins to block submittal temporarily (e.g. during ajax call) >+ return false; >+ } else if( !StrAlert && StrWarning ) { > // Check important fields > $("#check_errors").html( StrWarning ); > $('html, body').animate({ scrollTop: 0 }, 'fast'); >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35062
:
157226
|
157873
| 160936