all files / lib/src/instance/methods/ clean.js

8.33% Statements 1/12
0% Branches 0/4
0% Functions 0/2
9.09% Lines 1/11
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25                                               
import { each } from '../../utils/generic'
import { getNodes } from '../../utils/core'
import rinse from '../functions/rinse'
 
 
export default function clean (target) {
	var this$1 = this;
 
 
	var dirty
 
	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]
		}
	})
 
	if (dirty) { rinse.call(this) }
}