MCPcopy
hub / github.com/winjs/winjs / setTemporaryStyles

Function setTemporaryStyles

src/js/WinJS/Animations/_TransitionAnimation.js:135–170  ·  view source on GitHub ↗
(elem, id, style, actions, desc)

Source from the content-addressed store, hash-verified

133 });
134
135 function setTemporaryStyles(elem, id, style, actions, desc) {
136 var styleCache = desc.styleCaches[id] ||
137 new StyleCache(id, desc, style);
138 styleCache.cref += actions.length;
139
140 actions.forEach(function (action) {
141 stopExistingAction(id, action.property);
142 });
143
144 if (desc.isTransition ||
145 actions.some(function (action) {
146 return styleCache.removed[action[desc.nameField]];
147 })) {
148 resolveStyles(elem);
149 styleCache.removed = {};
150 }
151
152 var newShorthand = actions.map(function (action) {
153 return action[desc.nameField] + " " +
154 desc.props.map(function (p) {
155 return (p[1] ? action[p[1]] : "") + p[2];
156 }).join(" ");
157 }).join(", ");
158
159 var newNames = actions.map(function (action) {
160 return action[desc.nameField];
161 }).join(", ");
162 if (styleCache.names !== "") {
163 newShorthand = styleCache.names + ", " + newShorthand;
164 newNames = styleCache.names + ", " + newNames;
165 }
166
167 style[desc.shorthandProp] = newShorthand;
168 styleCache.names = newNames;
169 return styleCache;
170 }
171
172 var elementTransitionProperties = {
173 shorthandProp: browserStyleEquivalents["transition"].scriptName,

Callers 2

executeElementTransitionFunction · 0.85
executeElementAnimationFunction · 0.85

Calls 6

stopExistingActionFunction · 0.85
resolveStylesFunction · 0.85
forEachMethod · 0.65
someMethod · 0.65
joinMethod · 0.65
mapMethod · 0.65

Tested by

no test coverage detected