(target)
| 5 | import { applyStyle } from '../functions/style' |
| 6 | |
| 7 | export default function clean(target) { |
| 8 | let dirty |
| 9 | try { |
| 10 | each($(target), node => { |
| 11 | const id = node.getAttribute('data-sr-id') |
| 12 | if (id !== null) { |
| 13 | dirty = true |
| 14 | const element = this.store.elements[id] |
| 15 | if (element.callbackTimer) { |
| 16 | window.clearTimeout(element.callbackTimer.clock) |
| 17 | } |
| 18 | applyStyle(element.node, element.styles.inline.generated) |
| 19 | node.removeAttribute('data-sr-id') |
| 20 | delete this.store.elements[id] |
| 21 | } |
| 22 | }) |
| 23 | } catch (e) { |
| 24 | return logger.call(this, 'Clean failed.', e.message) |
| 25 | } |
| 26 | |
| 27 | if (dirty) { |
| 28 | try { |
| 29 | rinse.call(this) |
| 30 | } catch (e) { |
| 31 | return logger.call(this, 'Clean failed.', e.message) |
| 32 | } |
| 33 | } |
| 34 | } |
nothing calls this directly
no test coverage detected