easy 23.1.0 → 23.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/element.js CHANGED
@@ -253,38 +253,35 @@ export default class Element {
253
253
 
254
254
  css(css = null) {
255
255
  if (css === null) {
256
- const computedStyle = getComputedStyle(this.domElement),
257
- css = {};
256
+ css = {};
258
257
 
259
- for (let index = 0; index < computedStyle.length; index++) {
260
- const firstComputedStyle = first[computedStyle],
261
- name = firstComputedStyle, ///
262
- value = computedStyle.getPropertyValue(name); ///
258
+ const computedStyles = getComputedStyle(this.domElement); ///
259
+
260
+ for (let index = 0; index < computedStyles.length; index++) {
261
+ const computedStyle = computedStyles[index],
262
+ name = computedStyle, ///
263
+ value = computedStyles.getPropertyValue(name); ///
263
264
 
264
265
  css[name] = value;
265
266
  }
266
-
267
- return css;
268
- }
269
-
270
- if (typeof css === STRING) {
267
+ } else if (typeof css === STRING) {
271
268
  let name = css; ///
272
269
 
273
- const computedStyle = getComputedStyle(this.domElement),
274
- value = computedStyle.getPropertyValue(name); ///
270
+ const computedStyles = getComputedStyle(this.domElement), ///
271
+ value = computedStyles.getPropertyValue(name); ///
275
272
 
276
273
  css = value; ///
274
+ } else {
275
+ const names = Object.keys(css); ///
277
276
 
278
- return css;
279
- }
280
-
281
- const names = Object.keys(css); ///
277
+ names.forEach((name) => {
278
+ const value = css[name];
282
279
 
283
- names.forEach((name) => {
284
- const value = css[name];
280
+ this.style(name, value);
281
+ });
282
+ }
285
283
 
286
- this.style(name, value);
287
- });
284
+ return css;
288
285
  }
289
286
 
290
287
  destroy() {