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

window resize doesn't work for fixed-right #24

Closed
newghost opened this issue Dec 29, 2015 · 2 comments
Closed

window resize doesn't work for fixed-right #24

newghost opened this issue Dec 29, 2015 · 2 comments

Comments

@newghost
Copy link

This code doesn't work for fixed-right pane, and fixed-left works fine.

$(document).on('resize', function() {
  console.log('resized')
}).trigger('resize')

I comments this line for work around
event.stopPropagation();

/**
 * A special event that will "capture" a resize event from the parent split-pane or window.
 * The event will NOT propagate to grandchildren.
 */
$.event.special._splitpaneparentresize = {
    setup: function(data, namespaces) {
        var element = this,
            parent = $(this).parent().closest('.split-pane')[0] || window;
        $(this).data(SPLITPANERESIZE_HANDLER, function(event) {
            var target = event.target === document ? window : event.target;
            if (target === parent) {
                event.type = "_splitpaneparentresize";
                $.event.dispatch.apply(element, arguments);
            } else {

                //event.stopPropagation();
            }
        });
        $(parent).on('resize', $(this).data(SPLITPANERESIZE_HANDLER));
    },
    teardown: function(namespaces) {
        var parent = $(this).parent().closest('.split-pane')[0] || window;
        $(parent).off('resize', $(this).data(SPLITPANERESIZE_HANDLER));
        $(this).removeData(SPLITPANERESIZE_HANDLER);
    }
};
@shagstrom
Copy link
Owner

Thanks for reporting this! This has now been fixed in version 0.8.0.

@newghost
Copy link
Author

newghost commented Jan 4, 2016

Thank you, works fine.

$(document).on('splitpaneresize', function() {

    //

}).trigger('splitpaneresize')

@newghost newghost closed this as completed Jan 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants