I am using backbone undo js for undo
and redo
,I need to check whether undo or redo is available.
is there any method like hasundo()
and hasredo()
View = Backbone.View.extend({
initialize: function () {
// If the model's value changes, update the view
this.model.on("change:value", function (model, value, options) {
if (value != this.$el.html()) {
this.$el.html(value);
//need to check here,and add code for enable or disable my undo/redo buttons
}
}, this);
}
})