|
229 | 229 | zIndex: this.settings.z_index + 1 |
230 | 230 | }); |
231 | 231 | }, |
| 232 | + isFunction: function(element) { |
| 233 | + return typeof element === 'function'; |
| 234 | + }, |
232 | 235 | placement: function() { |
233 | 236 | var css, hasAnimation, offsetAmt, self, settings; |
234 | 237 | self = this; |
|
267 | 270 | offsetAmt = parseInt(offsetAmt) + parseInt(this.settings.spacing) + this.$ele.outerHeight(); |
268 | 271 | this.reposition(offsetAmt); |
269 | 272 | } |
270 | | - if ($.isFunction(self.settings.onShow)) { |
| 273 | + if (self.isFunction(self.settings.onShow)) { |
271 | 274 | self.settings.onShow.call(this.$ele); |
272 | 275 | } |
273 | 276 | this.$ele.one(this.animations.start, function() { |
274 | 277 | hasAnimation = true; |
275 | 278 | }).one(this.animations.end, function() { |
276 | 279 | self.$ele.removeClass(self.settings.animate.enter); |
277 | | - if ($.isFunction(self.settings.onShown)) { |
| 280 | + if (self.isFunction(self.settings.onShown)) { |
278 | 281 | self.settings.onShown.call(this); |
279 | 282 | } |
280 | 283 | }); |
281 | 284 | setTimeout((function() { |
282 | 285 | if (!hasAnimation) { |
283 | | - if ($.isFunction(self.settings.onShown)) { |
| 286 | + if (self.isFunction(self.settings.onShown)) { |
284 | 287 | self.settings.onShown.call(this); |
285 | 288 | } |
286 | 289 | } |
|
292 | 295 | this.$ele.find('[data-notify="dismiss"]').on('click', function() { |
293 | 296 | self.close(); |
294 | 297 | }); |
295 | | - if ($.isFunction(self.settings.onClick)) { |
| 298 | + if (self.isFunction(self.settings.onClick)) { |
296 | 299 | this.$ele.on('click', function(event) { |
297 | 300 | if (event.target !== self.$ele.find('[data-notify="dismiss"]')[0]) { |
298 | 301 | self.settings.onClick.call(this, event); |
|
329 | 332 | hasAnimation = false; |
330 | 333 | this.$ele.attr('data-closing', 'true').addClass(this.settings.animate.exit); |
331 | 334 | self.reposition(posX); |
332 | | - if ($.isFunction(self.settings.onClose)) { |
| 335 | + if (self.isFunction(self.settings.onClose)) { |
333 | 336 | self.settings.onClose.call(this.$ele); |
334 | 337 | } |
335 | 338 | this.$ele.one(this.animations.start, function() { |
336 | 339 | hasAnimation = true; |
337 | 340 | }).one(this.animations.end, function() { |
338 | 341 | $(this).remove(); |
339 | | - if ($.isFunction(self.settings.onClosed)) { |
| 342 | + if (self.isFunction(self.settings.onClosed)) { |
340 | 343 | self.settings.onClosed.call(this); |
341 | 344 | } |
342 | 345 | }); |
343 | 346 | setTimeout((function() { |
344 | 347 | if (!hasAnimation) { |
345 | 348 | self.$ele.remove(); |
346 | | - if ($.isFunction(self.settings.onClosed)) { |
| 349 | + if (self.isFunction(self.settings.onClosed)) { |
347 | 350 | self.settings.onClosed.call(this); |
348 | 351 | } |
349 | 352 | } |
|
0 commit comments