MCPcopy
hub / github.com/tdewolff/minify / createBlurDefaultState

Function createBlurDefaultState

_benchmarks/sample_echarts.js:12196–12216  ·  view source on GitHub ↗
(el, stateName, state)

Source from the content-addressed store, hash-verified

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];

Callers 1

elementStateProxyFunction · 0.85

Calls 3

getFromStateStyleFunction · 0.85
indexOfFunction · 0.70
extendFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…