From f43ee629910b136a62376fe960bc7fe3772e5a3b Mon Sep 17 00:00:00 2001 From: Luis Leiva Date: Sun, 27 Nov 2016 21:32:46 +0100 Subject: [PATCH] Retain old configuration when calling the 'configure' method --- jquery.sketchable.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jquery.sketchable.js b/jquery.sketchable.js index d94a04b..b911e79 100644 --- a/jquery.sketchable.js +++ b/jquery.sketchable.js @@ -76,6 +76,7 @@ }, /** * Changes config on the fly of an existing sketchable element. + * Previous options are retained. To completely reconfigure them just use the reset method. * @param {Object} opts - Plugin configuration (see defaults). * @return jQuery * @namespace methods.config @@ -86,7 +87,7 @@ config: function(opts) { return this.each(function(){ var elem = $(this), data = elem.data(_ns); - data.options = $.extend(true, {}, $.fn.sketchable.defaults, opts || {}); + data.options = $.extend(true, opts || {}, $.fn.sketchable.defaults, data.options); }); }, /**