/* popModal - 23.05.14 */ /* popModal */ (function($) { $.fn.popModal = function(method) { var elem = $(this), elemObj, isFixed = '', expandView = true, closeBut = '', elemClass = 'popModal', _options, animTime, effectIn = 'fadeIn', effectOut = 'fadeOut', bl = 'bottomLeft', bc = 'bottomCenter', br = 'bottomRight', lt = 'leftTop', lc = 'leftCenter', rt = 'rightTop', rc = 'rightCenter'; var methods = { init : function(params) { var _defaults = { html: '', placement: bl, showCloseBut: true, onDocumentClickClose : true, onOkBut: function() {return true;}, onCancelBut: function() {}, onLoad: function() {}, onClose: function() {} }; _options = $.extend(_defaults, params); if (elem.next('div').hasClass(elemClass)) { popModalClose(); } else { $('html.' + elemClass + 'Open').off('.' + elemClass + 'Event').removeClass(elemClass + 'Open'); $('.' + elemClass + '_source').replaceWith($('.' + elemClass + '_content').children()); $('.' + elemClass).remove(); if (_options.showCloseBut) { closeBut = $(''); } if (elem.css('position') == 'fixed') { isFixed = 'position:fixed;'; } var tooltipContainer = $('
'); var tooltipContent = $(''); tooltipContainer.append(closeBut, tooltipContent); if ($.isFunction(_options.html)) { var beforeLoadingContent = 'Please, waiting...'; tooltipContent.append(beforeLoadingContent); _options.html(function(loadedContent) { tooltipContent.empty().append(loadedContent); elemObj = $('.' + elemClass); expandView = true; if (tooltipContent[0].innerHTML.search(/