Skip to content

StickyWin.Modal - Modal 100% height not working #74

@ghost

Description

When window has no vertical scroll and I popup StickyWIn.Modal with contents that create vertical scroll bars, modal window does not stretch to 100% height.

I noticed that on clientcide StickyWin.modal demo (http://www.clientcide.com/wiki/cnet-libraries/07-ui/07-stickywin.modal) it is using modalizer (which is depreciated) and the position of modal is set to 'fixed' (which works perfectly), and the new script is using Mask which sets the position to absolute and has an option to correct the missing vertical scroll however Modal window is displayed before stickywin and at that point in time there is no scroll therefore it is not 100% height.

I was able to temporary fix it by overriding StickyWin.Modal.show method from:

function(showModal){
if ($pick(showModal, this.options.modalize))
this.mask.show();
this.parent();
}

to:

function(showModal){
if ($pick(showModal, this.options.modalize))
this.mask.show().element.setStyle('position','fixed');
this.parent();
}

Hope that clarifies the issue.

[update]
one more usefull line of code to add above this.parent(); would be:
window.addEvent('resize', this.position.bind(this));

So my final fix looks like this:

StickyWin.Modal.implement({
show: function(showModal){
if ($pick(showModal, this.options.modalize)) this.mask.show().element.setStyle('position','fixed');
window.addEvent('resize', this.position.bind(this));
this.parent();
}
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions