Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 221203e

Browse files
author
Wojciech Połowniak
committed
Formatting improvements
1 parent 24b2e6b commit 221203e

1 file changed

Lines changed: 25 additions & 27 deletions

File tree

src/LiveDevelopment/Agents/RemoteFunctions.js

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ function RemoteFunctions(config, remoteWSPort) {
4040
experimental = config.experimental;
4141
}
4242
var lastKeepAliveTime = Date.now();
43-
var req, timeout;
44-
var animateHighlight = function (time) {
45-
if(req) {
46-
window.cancelAnimationFrame(req);
47-
window.clearTimeout(timeout);
48-
}
49-
req = window.requestAnimationFrame(redrawHighlights);
50-
51-
timeout = setTimeout(function () {
52-
window.cancelAnimationFrame(req);
53-
req = null;
54-
}, time * 1000);
55-
};
43+
var req, timeout;
44+
var animateHighlight = function (time) {
45+
if(req) {
46+
window.cancelAnimationFrame(req);
47+
window.clearTimeout(timeout);
48+
}
49+
req = window.requestAnimationFrame(redrawHighlights);
50+
51+
timeout = setTimeout(function () {
52+
window.cancelAnimationFrame(req);
53+
req = null;
54+
}, time * 1000);
55+
};
5656

5757
/**
5858
* @type {DOMEditHandler}
@@ -290,23 +290,24 @@ function RemoteFunctions(config, remoteWSPort) {
290290
}
291291

292292
var realElBorder = {
293-
"right": elementStyling.getPropertyValue('border-right-width'),
294-
"left": elementStyling.getPropertyValue('border-left-width'),
295-
"top": elementStyling.getPropertyValue('border-top-width'),
296-
"bottom": elementStyling.getPropertyValue('border-bottom-width'),
293+
right: elementStyling.getPropertyValue('border-right-width'),
294+
left: elementStyling.getPropertyValue('border-left-width'),
295+
top: elementStyling.getPropertyValue('border-top-width'),
296+
bottom: elementStyling.getPropertyValue('border-bottom-width'),
297297
};
298298

299299
var innerWidth = elementBounds.width - parseInt(realElBorder.left) - parseInt(realElBorder.right);
300300
var innerHeight = elementBounds.height - parseInt(realElBorder.top) - parseInt(realElBorder.bottom);
301301

302-
var visualisations = [];
303-
visualisations['horizontal'] = "left, right";
304-
visualisations['vertical'] = "top, bottom";
302+
var visualisations = {
303+
horizontal: "left, right",
304+
vertical: "top, bottom"
305+
};
305306

306307
var drawPaddingRect = function(side) {
307308
var elStyling = {};
308309

309-
if(visualisations['horizontal'].indexOf(side) >= 0) {
310+
if (visualisations.horizontal.indexOf(side) >= 0) {
310311
elStyling['width'] = elementStyling.getPropertyValue('padding-' + side);
311312
elStyling['height'] = innerHeight + "px";
312313
elStyling['top'] = realElBorder.top;
@@ -326,7 +327,7 @@ function RemoteFunctions(config, remoteWSPort) {
326327
var drawMarginRect = function(side) {
327328
var elStyling = {};
328329

329-
var margin = [];
330+
var margin = [];
330331
margin['right'] = parseInt(elementStyling.getPropertyValue('margin-right'));
331332
margin['top'] = parseInt(elementStyling.getPropertyValue('margin-top'));
332333
margin['bottom'] = parseInt(elementStyling.getPropertyValue('margin-bottom'));
@@ -363,7 +364,7 @@ function RemoteFunctions(config, remoteWSPort) {
363364
};
364365

365366
var mainBoxStyles = config.remoteHighlight.stylesToSet;
366-
mainBoxStyles['border'] = 'none';
367+
mainBoxStyles['border'] = 'none';
367368

368369
var paddingVisualisations = [
369370
drawPaddingRect('top'),
@@ -394,10 +395,7 @@ function RemoteFunctions(config, remoteWSPort) {
394395
arr[i]
395396
);
396397

397-
_setStyleValues(
398-
styles,
399-
el.style
400-
);
398+
_setStyleValues(styles, el.style);
401399

402400
highlight.appendChild(el);
403401
}

0 commit comments

Comments
 (0)