Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Hwang committed Jun 2, 2015
1 parent bf2840a commit 1e4ed70
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/js/drop.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function removeFromArray(arr, item) {
while((index = arr.indexOf(item)) !== -1) {
results.push(arr.splice(index, 1));
}
return results
return results;
}

let clickEvents = ['click'];
Expand Down Expand Up @@ -54,9 +54,9 @@ const MIRROR_ATTACH = {
bottom: 'top',
middle: 'middle',
center: 'center'
}
};

let allDrops = {}
let allDrops = {};

// Drop can be included in external libraries. Calling createContext gives you a fresh
// copy of drop which won't interact with other copies on the page (beyond calling the document events).
Expand Down Expand Up @@ -115,7 +115,7 @@ function createContext(options={}) {

class DropInstance extends Evented {
constructor(opts) {
super()
super();
this.options = extend({}, drop.defaults, opts);
this.target = this.options.target;

Expand Down Expand Up @@ -168,7 +168,7 @@ function createContext(options={}) {

};

generateAndSetContent()
generateAndSetContent();
this.on('open', generateAndSetContent.bind(this));
} else if (typeof this.options.content === 'object') {
this.content.appendChild(this.options.content);
Expand Down Expand Up @@ -238,16 +238,16 @@ function createContext(options={}) {
}

if (this.options.openOn === 'always') {
setTimeout(this.open.bind(this))
setTimeout(this.open.bind(this));
return;
}

const events = this.options.openOn.split(' ');

if (events.indexOf('click') >= 0) {
const openHandler = (event) => {
this.toggle()
event.preventDefault()
this.toggle();
event.preventDefault();
};

const closeHandler = (event) => {
Expand All @@ -265,7 +265,7 @@ function createContext(options={}) {
return;
}

this.close()
this.close();
};

for (let i = 0; i < clickEvents.length; ++i) {
Expand All @@ -285,19 +285,19 @@ function createContext(options={}) {

let outTimeout = null;
const out = () => {
onUs = false
onUs = false;

if (typeof outTimeout !== 'undefined') {
clearTimeout(outTimeout)
clearTimeout(outTimeout);
}

outTimeout = setTimeout(() => {
if (!onUs) {
this.close();
}
outTimeout = null;
}, 50)
}
}, 50);
};

this._on(this.target, 'mouseover', over);
this._on(this.drop, 'mouseover', over);
Expand All @@ -314,9 +314,9 @@ function createContext(options={}) {

toggle() {
if (this.isOpened()) {
this.close()
this.close();
} else {
this.open()
this.open();
}
}

Expand All @@ -330,7 +330,7 @@ function createContext(options={}) {
}

if (typeof this.tether !== 'undefined') {
this.tether.enable()
this.tether.enable();
}

addClass(this.drop, `${ drop.classPrefix }-open`);
Expand All @@ -340,7 +340,7 @@ function createContext(options={}) {
if (this.drop) {
addClass(this.drop, `${ drop.classPrefix }-after-open`);
}
})
});

if (typeof this.tether !== 'undefined') {
this.tether.position();
Expand All @@ -364,7 +364,7 @@ function createContext(options={}) {
removeClass(this.drop, `${ drop.classPrefix }-open-transitionend`);
}
this.drop.removeEventListener(transitionEndEvent, handler);
}
};

this.drop.addEventListener(transitionEndEvent, handler);

Expand Down Expand Up @@ -426,5 +426,5 @@ const Drop = createContext();

document.addEventListener('DOMContentLoaded', () => {
Drop.updateBodyClasses();
})
});

0 comments on commit 1e4ed70

Please sign in to comment.