New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fieldflow plugin - Initial commit, transform a basic list into a selectable list. #7790
Conversation
src/plugins/fieldflow/fieldflow.js
Outdated
* | ||
* Add a parameter to the detination URL like "?name=value" | ||
*/ | ||
$document.on( "redir." + submitEvent, selector, function( event, data ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Collapse function with previous one and use switch
to reduce code duplication
src/plugins/fieldflow/fieldflow.js
Outdated
* | ||
* Add a parameter to the detination URL like "?name=value" | ||
*/ | ||
$document.on( "query." + actionEvent, selector, function( event, data ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Collapse function with previous one and use switch
to reduce code duplication
src/plugins/fieldflow/fieldflow.js
Outdated
* @dt: Data structure defining this ajax loading configuration | ||
* | ||
*/ | ||
$document.on( "ajax." + actionEvent, selector, function( event, data ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Collapse function with previous one and use switch
to reduce code duplication
src/plugins/fieldflow/fieldflow.js
Outdated
* | ||
* Add a parameter to the detination URL like "?name=value" | ||
*/ | ||
$document.on( "ajax." + submitEvent, selector, function( event, data ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Collapse function with previous one and use switch
to reduce code duplication
src/plugins/fieldflow/fieldflow.js
Outdated
} ); | ||
|
||
// Toggle an items | ||
$document.on( "toggle." + actionEvent, selector, function( event, data ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Collapse function with previous one and use switch
to reduce code duplication
src/plugins/fieldflow/fieldflow.js
Outdated
* | ||
* Add a parameter to the detination URL like "?name=value" | ||
*/ | ||
$document.on( "toggle." + submitEvent, selector, function( event, data ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Collapse function with previous one and use switch
to reduce code duplication
src/plugins/fieldflow/fieldflow.js
Outdated
} ); | ||
|
||
// addClass action | ||
$document.on( "addClass." + submitEvent, selector, function( event, data ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Collapse function with previous one and use switch
to reduce code duplication
src/plugins/fieldflow/fieldflow.js
Outdated
} ); | ||
|
||
// removeClass action | ||
$document.on( "removeClass." + actionEvent, selector, function( event, data ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Collapse function with previous one and use switch
to reduce code duplication
src/plugins/fieldflow/fieldflow.js
Outdated
} ); | ||
|
||
// removeClass action | ||
$document.on( "removeClass." + submitEvent, selector, function( event, data ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Collapse function with previous one and use switch
to reduce code duplication
src/plugins/fieldflow/fieldflow.js
Outdated
} ); | ||
|
||
// Insert a control next to it | ||
$document.on( "append." + actionEvent, selector, function( event, data ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Collapse function with previous one and use switch
to reduce code duplication
@LaurentGoderre as you asked, I collapsed all the function with previous one and now it uses a |
Much cleaner and leaner! |
To be moved into the gc web theme, as this plugin execute business logic. |
This plugin is merged in GC Web |
Note, the following working example link are based on build 4154900
English working example:
French working example:
Documentation:
i18n temporary workaround
Currently the plugin only support English and French and use a work-around for i18n.
The following text will need to be translated in all language supported by WET, then added to the cvs, then I will be able to update the plugin to fully support the i18n of WET.
cc/ @TouficS