Create a gist now

Instantly share code, notes, and snippets.

@Kcko /modal.js
Created May 18, 2017

What would you like to do?
Modal object with private functions
function feedbackModalFn(selector){
//var feedbackModal = $('.feedback-modal');
var feedbackModal = $(selector);
var winH;
var topPane;
var feedbackModalHeight;
// private scope
function init()
{
winH = $(window).height();
//topPane = $('.top-pane').height();
topPane = 0;
feedbackModalHeight = winH - topPane;
feedbackModal.height(feedbackModalHeight);
}
// private scope
function show()
{
init();
feedbackModal.animate({
bottom: 0
}, 600);
}
// private scope
function hide()
{
init();
feedbackModal.animate({
bottom: "-" + feedbackModalHeight
}, 600);
}
return {
'init': init,
'show': show,
'hide': hide
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment