on master help sign in
cosmetic: make whitespace in updateProps nicer
commitc7ab5218cb699a7a9e76e85cd092bd2f45b64554 authorEvan Czaplicki <info@elm-lang.org> dateThu 24 Jul 2014, 19:10 (12 years ago) parentc39056f
1 file changed+11−3
runtime/Render/Element.js+11−3
runtime/Render/Element.js+11−3
@@ -356,6 +356,7 @@ function update(node, curr, next) {
356356function updateProps(node, curr, next) {
357357 var nextProps = next.props;
358358 var currProps = curr.props;
359+
359360 var element = next.element;
360361 var width = nextProps.width - (element.adjustWidth || 0);
361362 var height = nextProps.height - (element.adjustHeight || 0);
@@ -365,15 +366,22 @@ function updateProps(node, curr, next) {
365366 if (height !== currProps.height) {
366367 node.style.height = (height|0) + 'px';
367368 }
369+
368370 if (nextProps.opacity !== currProps.opacity) {
369371 node.style.opacity = nextProps.opacity;
370372 }
371− var nextColor = (nextProps.color.ctor === 'Just' ?
372− colorToCss(nextProps.color._0) : '');
373+
374+ var nextColor = nextProps.color.ctor === 'Just'
375+ ? colorToCss(nextProps.color._0)
376+ : '';
373377 if (node.style.backgroundColor !== nextColor) {
374378 node.style.backgroundColor = (nextColor === '' ? 'transparent' : nextColor);
375379 }
376− if (nextProps.tag !== currProps.tag) { node.id = nextProps.tag; }
380+
381+ if (nextProps.tag !== currProps.tag) {
382+ node.id = nextProps.tag;
383+ }
384+
377385 if (nextProps.href !== currProps.href) {
378386 if (currProps.href === '') {
379387 var a = newElement('a');