- Timestamp:
- 12/14/11 19:00:44 (5 months ago)
- File:
-
- 1 edited
-
trunk/inc/js/jquery.dolPopup.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/inc/js/jquery.dolPopup.js
r15752 r15762 19 19 onBeforeShow: function () {}, 20 20 onShow: function () {}, 21 onBeforeHide: function () {}, 22 onHide: function () {}, 21 23 speed: 150 22 24 }; … … 70 72 $el._dolPopupSetPosition(o); 71 73 72 // attach event for "close element"73 if (o.closeElement) {74 $(o.closeElement, $el)75 .css('cursor', 'hand')76 .click(function() {77 $el.dolPopupHide();78 });79 }80 81 74 if (!$el.hasClass('bx-popup-applied')) { // do this only once 82 75 $el.addClass('bx-popup-applied'); … … 84 77 // save options for element 85 78 $el.data('bx-popup-options', o); 79 80 // attach event for "close element" 81 if (o.closeElement) { 82 $(o.closeElement, $el) 83 .css('cursor', 'hand') 84 .click(function() { 85 $el.dolPopupHide(); 86 }); 87 } 86 88 87 89 // attach event for outer click checking … … 115 117 }; 116 118 117 $.fn.dolPopupHide = function(options) { 118 119 var defaults = { 120 onHide: function () {} 121 }; 122 123 var oHide = $.extend({}, defaults, options); 119 $.fn.dolPopupHide = function(options) { 120 121 if ('undefined' == typeof(options) || 'object' != typeof(options)) 122 options = {}; 124 123 125 124 return this.each(function() { … … 129 128 return false; 130 129 131 var o = $el.data('bx-popup-options'); 130 if (!$el.is(':visible') || 'hidden' == $el.css('visibility') || 'none' == $el.css('display')) 131 return false; 132 133 var o = $.extend({}, $el.data('bx-popup-options'), options); 132 134 133 135 if (!o) 134 136 return false; 135 137 136 if (!$el.is(':visible')) 137 return false; 138 o.onBeforeHide(); 138 139 139 140 if (o.speed > 0) { 140 141 if (o.fog) 141 142 $('#bx-popup-fog').fadeOut(o.speed); 142 $el.fadeOut(o.speed, o Hide.onHide);143 $el.fadeOut(o.speed, o.onHide); 143 144 } else { 144 145 if (o.fog) 145 146 $('#bx-popup-fog').hide(); 146 $el.hide(o Hide.onHide);147 $el.hide(o.onHide); 147 148 } 148 149 });
Note: See TracChangeset
for help on using the changeset viewer.