(el, stateName, state)
| 12194 | } |
| 12195 | |
| 12196 | function createBlurDefaultState(el, stateName, state) { |
| 12197 | var hasBlur = indexOf(el.currentStates, stateName) >= 0; |
| 12198 | var currentOpacity = el.style.opacity; |
| 12199 | var fromState = !hasBlur ? getFromStateStyle(el, ['opacity'], stateName, { |
| 12200 | opacity: 1 |
| 12201 | }) : null; |
| 12202 | state = state || {}; |
| 12203 | var blurStyle = state.style || {}; |
| 12204 | |
| 12205 | if (blurStyle.opacity == null) { |
| 12206 | // clone state |
| 12207 | state = extend({}, state); |
| 12208 | blurStyle = extend({ |
| 12209 | // Already being applied 'emphasis'. DON'T mul opacity multiple times. |
| 12210 | opacity: hasBlur ? currentOpacity : fromState.opacity * 0.1 |
| 12211 | }, blurStyle); |
| 12212 | state.style = blurStyle; |
| 12213 | } |
| 12214 | |
| 12215 | return state; |
| 12216 | } |
| 12217 | |
| 12218 | function elementStateProxy(stateName, targetStates) { |
| 12219 | var state = this.states[stateName]; |
no test coverage detected
searching dependent graphs…