Hook MementoCanvas to bound data

This commit is contained in:
Luis Leiva 2019-07-18 11:38:45 +03:00
parent 2a2d26cf0e
commit 892d51e457
2 changed files with 6 additions and 10 deletions

View File

@ -175,9 +175,6 @@
* @namespace $.fn.sketchable.plugins.memento
*/
$.fn.sketchable.plugins.memento = function($instance) {
// Access the instance configuration.
var config = $instance.sketchable('config');
var callbacks = {
clear: function(elem, data) {
data.memento.reset();
@ -263,8 +260,9 @@
});
// Initialize plugin here.
config.memento = new MementoCanvas($instance);
config.memento.init();
var data = $instance.sketchable('data');
data.memento = new MementoCanvas($instance);
data.memento.init();
};
})(jQuery);

View File

@ -177,9 +177,6 @@
* @namespace Sketchable.plugins.memento
*/
Sketchable.prototype.plugins.memento = function(instance) {
// Access the instance configuration.
var config = instance.config();
var callbacks = {
clear: function(elem, data) {
data.memento.reset();
@ -267,8 +264,9 @@
});
// Initialize plugin here.
config.memento = new MementoCanvas(instance);
config.memento.init();
var data = dataBind(instance.elem)[namespace];
data.memento = new MementoCanvas(instance);
data.memento.init();
};
})(this);