Skip to content
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

BugFix: mergeAjaxCallback events stacking #1204

Closed
wants to merge 2 commits into from
Closed

BugFix: mergeAjaxCallback events stacking #1204

wants to merge 2 commits into from

Conversation

Krnlsoft
Copy link

@Krnlsoft Krnlsoft commented Mar 19, 2018

Scope

This pull request includes a

  • Bug fix
  • New feature
  • Translation

The actual mergeAjaxCallback have some issues with events stacking,
causing events to stack and getting triggered multiple times,
this issue only happen when using mergeAjaxCallback = true or mergeAjaxDeleteCallbacks = true,

Specific code,
targFunc is stacked, because is returned from previous settings and then nested in the new function

            targFunc = settings[funcName];
            if (flag && typeof targFunc === "function") {
                if (flag === 'before') {
                    settings[funcName] = function () {
                        targFunc.apply(this, arguments);
                        srcFunc.apply(this, arguments);
                    };
                } else {
                    settings[funcName] = function () {
                        srcFunc.apply(this, arguments);
                        targFunc.apply(this, arguments);
                    };
                }
            }

Changes

I've made some private copies of the ajax settings to work with,
resetting them everytime a new merge occur.

Related Issues

If this is related to an existing ticket, include a link to it as well.

@kartik-v
Copy link
Owner

Thanks - can you submit a minified version of the JS file as well. You can do minification online via this site.

@kartik-v kartik-v added the bug label Mar 22, 2018
@kartik-v kartik-v closed this in bd6a65f Mar 22, 2018
kartik-v added a commit that referenced this pull request Mar 22, 2018
kartik-v added a commit that referenced this pull request Mar 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants