Closed belozer closed 8 years ago
Need add full reset flag. Default behavior - delete all mods and styles after "start" function.
/**
* Reset block mods and inline styles
* @param {Boolean} toLast to last saved state
* @return {Bem} block instance
*/
reset: function(toLast) {
this.domElem.css('display', '');
if (toLast && this._state.last) {
this._reset(this._state.last);
return this;
}
// Restore inited mods state
this._reset(this._state.inited);
return this;
},
/**
* Reset object to state
* @param {object} state mods
*/
_reset: function(state) {
objects.each(state.mods, (val, mod) => {
if (this._modCache[mod] === val) {
return;
}
this.setMod(mod, val);
});
objects.each(this._modCache, (val, mod) => {
if (state.mods[mod] === undefined) {
this.delMod(mod);
}
});
},
But I'm starting to think that this functionality is unnecessary...