Skip to content

Commit

Permalink
More formatting fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
zz85 committed May 16, 2020
1 parent 4de36da commit 95b19f7
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 26 deletions.
7 changes: 5 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"node": true,
"es6": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 8,
"ecmaVersion": 2020,
"sourceType": "module"
},
"rules": {
Expand All @@ -17,6 +18,8 @@
"no-unused-vars": "warn",
"no-undef": "error",
"no-trailing-spaces": "error",
"indent": ["error", "tab"]
"indent": ["error", "tab"],
"keyword-spacing": "error",
"object-curly-spacing": ["error", "always"]
}
}
4 changes: 2 additions & 2 deletions src/timeliner.js
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ function Timeliner(target) {
zIndex: (Z_INDEX - 1),
// transition: 'all 0.25s ease-in-out',
transitionProperty: 'top, left, width, height, opacity',
transitionDuration: '0.25s',
transitionDuration: '0.25s',
transitionTimingFunction: 'ease-in-out'
});

Expand Down Expand Up @@ -640,7 +640,7 @@ function Timeliner(target) {

// percentages
scrollbar.onScroll.do(function(type, scrollTo) {
switch(type) {
switch (type) {
case 'scrollto':
layer_panel.scrollTo(scrollTo);
timeline.scrollTo(scrollTo);
Expand Down
6 changes: 3 additions & 3 deletions src/ui_canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ function Canvas(w, h) {

handleDrag(canvas,
function down(e) {
if (child.onDown) { child.onDown(e) };
if (child.onDown) { child.onDown(e) }
},
function move(e) {
if (child.onMove) { child.onMove(e) };
if (child.onMove) { child.onMove(e) }
},
function up(e) {
if (child.onUp) { child.onUp(e) };
if (child.onUp) { child.onUp(e) }
}
// function hit(e) {
// if (child.onHit) { child.onHit(e) };
Expand Down
2 changes: 1 addition & 1 deletion src/ui_icon_button.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { font } from './font.js'
import { Theme } from './theme.js'
import { utils } from './utils.js'
const { style} = utils
const { style } = utils

function IconButton(size, icon, tooltip, dp) {
var iconStyle = {
Expand Down
6 changes: 3 additions & 3 deletions src/ui_number.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Theme } from './theme.js'
import {Do } from './utils/do.js'
import {handleDrag } from './util_handle_drag.js'
import { Do } from './utils/do.js'
import { handleDrag } from './util_handle_drag.js'
import { utils } from './utils.js'
const { firstDefined, style } = utils
;
Expand Down Expand Up @@ -73,7 +73,7 @@ function UINumber(config) {
// Disregard pixel/line/page scrolling and just
// use event direction.
var inc = e.deltaY > 0? 1 : -1;
if(e.altKey) {
if (e.altKey) {
inc *= wheelStepFine;
} else {
inc *= wheelStep;
Expand Down
2 changes: 1 addition & 1 deletion src/ui_scrollbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function ScrollBar(h, w, dispatcher) {

var scrolltrackHeight = h - 2;
scrolltrack.style.height = scrolltrackHeight + 'px';
scrolltrack.style.width = SCROLL_WIDTH + 'px';;
scrolltrack.style.width = SCROLL_WIDTH + 'px';

// var scrollTop = 0;
var scrollbar = document.createElement('div');
Expand Down
6 changes: 3 additions & 3 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ var STORAGE_PREFIX = 'timeliner-'
/**************************/

function firstDefined() {
for(var i = 0; i < arguments.length; i++) {
if(typeof arguments[i] !== 'undefined') {
for (var i = 0; i < arguments.length; i++) {
if (typeof arguments[i] !== 'undefined') {
return arguments[i];
}
}
Expand Down Expand Up @@ -270,7 +270,7 @@ function proxy_ctx(ctx) {
// string, number, boolean, function, object

var type = typeof(ctx[c]);
switch(type) {
switch (type) {
case 'object':
break;
case 'function':
Expand Down
2 changes: 1 addition & 1 deletion src/utils/docking_window.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ function DockingWindow(pane, ghostpane) {

var width, height, left, top;

switch(snapType) {
switch (snapType) {
case SNAP_FULL_SCREEN:
width = window.innerWidth;
height = window.innerHeight;
Expand Down
16 changes: 8 additions & 8 deletions src/view_panel.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { LayoutConstants} from './layout_constants.js'
import { Theme} from './theme.js'
import { utils} from './utils.js'
import { Tweens} from './util_tween.js'
import { handleDrag} from './util_handle_drag.js'
import { ScrollCanvas} from './view_time_scroller.js'
import { Canvas} from './ui_canvas.js'
import { LayoutConstants } from './layout_constants.js'
import { Theme } from './theme.js'
import { utils } from './utils.js'
import { Tweens } from './util_tween.js'
import { handleDrag } from './util_handle_drag.js'
import { ScrollCanvas } from './view_time_scroller.js'
import { Canvas } from './ui_canvas.js'

const proxy_ctx = utils.proxy_ctx;

Expand Down Expand Up @@ -548,7 +548,7 @@ function TimelinePanel(data, dispatcher) {
function onPointerMove(x, y) {
if (mousedownItem) return;
pointerdidMoved = true;
pointer = {x: x, y: y};
pointer = { x: x, y: y };
}

canvas.addEventListener('mouseout', function() {
Expand Down
3 changes: 1 addition & 2 deletions src/view_time_scroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ Rect.prototype.shape = function(ctx) {
};

Rect.prototype.contains = function(x, y) {
return x >= this.x && y >= this.y
&& x <= this.x + this.w && y <= this.y + this.h;
return x >= this.x && y >= this.y && x <= this.x + this.w && y <= this.y + this.h;
};


Expand Down

0 comments on commit 95b19f7

Please sign in to comment.