Created
May 18, 2017 10:03
-
-
Save Kcko/2d7457fc63512562956573569cdbe6c1 to your computer and use it in GitHub Desktop.
Modal object with private functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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