import { each } from '../../utils/generic'
import { getNodes, logger } from '../../utils/core'
import rinse from '../functions/rinse'
export default function clean (target) {
var this$1 = this;
var dirty
try {
each(getNodes(target), function (node) {
var id = node.getAttribute('data-sr-id')
if (id !== null) {
dirty = true
node.setAttribute('style', this$1.store.elements[id].styles.inline)
node.removeAttribute('data-sr-id')
delete this$1.store.elements[id]
}
})
} catch (e) {
return logger.call(this, 'Clean failed.', e.message)
}
if (dirty) {
try {
rinse.call(this)
} catch (e) {
return logger.call(this, 'Clean failed.', 'Rinse failed.', e.message)
}
}
}
|