Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var showDetailWindow = function(el, menu) {
- // change last elements text and set new element as last element
- parentEl = el;
- //get the position of the placeholder element
- jQuery('.modal-window-box').fadeOut();
- var leftOffset = 570;
- var topOffset = -20;
- var pos = jQuery(el).offset();
- var eWidth = jQuery(el).outerWidth() + leftOffset;
- var mWidth = jQuery(menu).outerWidth();
- var left = (pos.left + eWidth - mWidth) + "px";
- var top = topOffset+pos.top + "px";
- //show the menu directly over the placeholder
- jQuery(menu).css( {
- position: 'absolute',
- zIndex: 5000,
- left: left,
- top: top
- } );
- jQuery(menu).hide().fadeIn();
- };
- function showToggleMoreAttributes(categoryName){
- var modalHtml = jQuery("#modalContent"+categoryName).html();
- window.ModalWindow.draw(categoryName, modalHtml);
- }
- /*
- * function to remove the floating windows
- * todo: the "if" statement needs to be solved and cased a bit more precise ;)
- */
- var currentAction = afterDocumentReady.addAction();
- currentAction.doAfter = function()
- {
- // on click somewhere in the dom
- jQuery(document).click(function(e){
- if(e.target.className == "knm-modal-window" || e.target.className == "page" || e.target.className == "category-products"){window.ModalWindow.remove();}
- });
- // on escape key press destroy modal window
- jQuery(document).keyup(function(e) {
- if (e.keyCode == 27) {window.ModalWindow.remove();} // esc
- });
- window.initBodySize();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement