mirror of https://github.com/luileito/jsketch.git
Added a config method to change options on the fly
This commit is contained in:
parent
9e6bbd13a0
commit
78f257ebdc
|
|
@ -72,6 +72,21 @@
|
|||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Changes config on the fly of an existing sketchable element.
|
||||
* @param {Object} opts plugin configuration (see defaults).
|
||||
* @return jQuery
|
||||
* @namespace methods.config
|
||||
* @example
|
||||
* $(selector).sketchable('config', { interactive: false }); // Then:
|
||||
* $(selector).sketchable('config', { interactive: true });
|
||||
*/
|
||||
config: function(opts) {
|
||||
return this.each(function(){
|
||||
var elem = $(this), data = elem.data(_ns);
|
||||
data.options = $.extend(true, {}, $.fn.sketchable.defaults, opts || {});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Gets/Sets drawing data strokes sequence.
|
||||
* @param {Array} arr - Multidimensional array of [x,y,time,status] tuples; status = 0 (pen down) or 1 (pen up).
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue