Skip to content

Commit

Permalink
Fix linting issues, also started working on example
Browse files Browse the repository at this point in the history
  • Loading branch information
unimonkiez committed Apr 13, 2016
1 parent a1e74dd commit 2b484ec
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 21 deletions.
3 changes: 1 addition & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"env": {
"es6": true,
"node": true,
"browser": false
"browser": true
},
"globals": {
"__DEV__": false,
Expand Down Expand Up @@ -40,7 +40,6 @@
"use-isnan": 2,
"valid-jsdoc": 0,
"valid-typeof": 2,

"block-scoped-var": 0,
"complexity": 0,
"consistent-return": 0,
Expand Down
7 changes: 0 additions & 7 deletions example/.eslintrc

This file was deleted.

10 changes: 9 additions & 1 deletion example/example.js
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
console.log(12345);
import EmojiWindow from 'emoji-window';

document.getElementById('button-example-1').addEventListener('click', e => {
new EmojiWindow({
position: {
el: e.target
}
});
});
7 changes: 5 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
<head>
<meta charset="utf-8">
<title>Emoji window example</title>
<script type="text/javascript" src="dist/example.min.js"></script>
</head>
<body>
Yuval
<div>
<div>Example 1</div>
<button id="button-example-1">Click me</button>
</div>
<script type="text/javascript" src="dist/example.min.js"></script>
</body>
</html>
7 changes: 0 additions & 7 deletions src/.eslintrc

This file was deleted.

17 changes: 16 additions & 1 deletion src/emoji-window.js
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
alert(12223);
import emojiData from 'emoji-data/emoji.json';

const existingWindowSets = {};
export default class EmojiWindow {
constructor({
position: {
el,
x,
y
} = {}
} = {}) {
const left = x !== undefined ? x : (el.offsetLeft + el.clientWidth);
const top = y !== undefined ? y : (el.offsetTop + el.clientHeight);
console.log(emojiData);
}
}
10 changes: 9 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,20 @@ module.exports = {
loaders: [
{
test: /\.js$/,
include: [path.resolve(__dirname, 'src')],
include: [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'example')
],
loader: 'babel',
query: {
presets: ['es2015']
}
}
]
},
resolve: {
alias: {
'emoji-window': path.join(__dirname, 'src', 'emoji-window.js')
}
}
};

0 comments on commit 2b484ec

Please sign in to comment.