mirror of https://github.com/luileito/jsketch.git
Hook MementoCanvas to bound data
This commit is contained in:
parent
2a2d26cf0e
commit
892d51e457
|
|
@ -175,9 +175,6 @@
|
||||||
* @namespace $.fn.sketchable.plugins.memento
|
* @namespace $.fn.sketchable.plugins.memento
|
||||||
*/
|
*/
|
||||||
$.fn.sketchable.plugins.memento = function($instance) {
|
$.fn.sketchable.plugins.memento = function($instance) {
|
||||||
// Access the instance configuration.
|
|
||||||
var config = $instance.sketchable('config');
|
|
||||||
|
|
||||||
var callbacks = {
|
var callbacks = {
|
||||||
clear: function(elem, data) {
|
clear: function(elem, data) {
|
||||||
data.memento.reset();
|
data.memento.reset();
|
||||||
|
|
@ -263,8 +260,9 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
// Initialize plugin here.
|
// Initialize plugin here.
|
||||||
config.memento = new MementoCanvas($instance);
|
var data = $instance.sketchable('data');
|
||||||
config.memento.init();
|
data.memento = new MementoCanvas($instance);
|
||||||
|
data.memento.init();
|
||||||
};
|
};
|
||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
|
|
||||||
|
|
@ -177,9 +177,6 @@
|
||||||
* @namespace Sketchable.plugins.memento
|
* @namespace Sketchable.plugins.memento
|
||||||
*/
|
*/
|
||||||
Sketchable.prototype.plugins.memento = function(instance) {
|
Sketchable.prototype.plugins.memento = function(instance) {
|
||||||
// Access the instance configuration.
|
|
||||||
var config = instance.config();
|
|
||||||
|
|
||||||
var callbacks = {
|
var callbacks = {
|
||||||
clear: function(elem, data) {
|
clear: function(elem, data) {
|
||||||
data.memento.reset();
|
data.memento.reset();
|
||||||
|
|
@ -267,8 +264,9 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
// Initialize plugin here.
|
// Initialize plugin here.
|
||||||
config.memento = new MementoCanvas(instance);
|
var data = dataBind(instance.elem)[namespace];
|
||||||
config.memento.init();
|
data.memento = new MementoCanvas(instance);
|
||||||
|
data.memento.init();
|
||||||
};
|
};
|
||||||
|
|
||||||
})(this);
|
})(this);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue