Default options get overwritten by user options #71

Closed
scovetta opened this Issue Aug 10, 2012 · 0 comments

2 participants

@scovetta

Minor bug in NotyObject.init:

// Mix in the passed in options with the default options
this.options = $.extend({}, $.noty.defaults, options); <-- Broken

// Mix in the passed in options with the default options
this.options = $.extend(true, {}, $.noty.defaults, options); <-- Fixed

(See http://api.jquery.com/jQuery.extend/ on the deep copy).

Problem was that if you did:
noty( { text: 'fool', type: 'success', callback: { onClose: function() { bar() } } );

Then then callback array would be overwritten by the passed callback array, instead of merging as you'd expect.

@needim needim closed this Aug 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment