Skip to content

Commit

Permalink
Fixed #1 & moved demo to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
m-thalmann committed Oct 2, 2020
1 parent 8780cc4 commit 414e86b
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ContextmenuJS is a simple JavaScript library, to display custom contextmenus (right-click).

**Demo:** https://prod.thalmann.it/contextmenujs/demo.html
**Demo:** https://m-thalmann.github.io/contextmenujs/

## Navigation
- [Installation](#installation)
Expand Down Expand Up @@ -199,4 +199,4 @@ var menu = new ContextMenu(

### Output:

![contextmenuJs example](demo/example.gif)
![contextmenuJs example](docs/example.gif)
1 change: 0 additions & 1 deletion _config.yml

This file was deleted.

3 changes: 2 additions & 1 deletion contextmenu.css
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
}

.cm_container.cm_border_right > ul ul{
left: -100%;
left: unset;
right: 100%;
}

.cm_container.cm_border_bottom > ul ul{
Expand Down
2 changes: 1 addition & 1 deletion contextmenu.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes
23 changes: 22 additions & 1 deletion demo/index.html → docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ContextmenuJS - Demo Page</title>

<link rel="stylesheet" href="../contextmenu.css" />
<link rel="stylesheet" href="../contextmenu.css" id="theme_style" />
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
<script src="../contextmenu.js"></script>

Expand Down Expand Up @@ -54,6 +54,18 @@
menu.display(e);
});
});

const themes = {
default: '../contextmenu.css',
light: '../themes/contextmenu_light.css',
dark: '../themes/contextmenu_dark.css',
};

function changeTheme(e){
if(Object.keys(themes).indexOf(e.value) === -1) return;

document.getElementById('theme_style').href = themes[e.value];
}
</script>

<style>
Expand Down Expand Up @@ -111,6 +123,15 @@ <h1>ContextMenu Test</h1>
</header>

<main>
<p style="margin-top: 0">
<span>Theme: </span>
<select onchange="changeTheme(this)">
<option value="default">Default</option>
<option value="light">Light</option>
<option value="dark">Dark</option>
</select>
</p>

<div id="cmenu">
Right-click this blue box
</div>
Expand Down
3 changes: 2 additions & 1 deletion themes/contextmenu_dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@
}

.cm_container.cm_border_right > ul ul{
left: -100%;
left: unset;
right: 100%;
}

.cm_container.cm_border_bottom > ul ul{
Expand Down
2 changes: 1 addition & 1 deletion themes/contextmenu_dark.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion themes/contextmenu_light.css
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
}

.cm_container.cm_border_right > ul ul{
left: -100%;
left: unset;
right: 100%;
}

.cm_container.cm_border_bottom > ul ul{
Expand Down
2 changes: 1 addition & 1 deletion themes/contextmenu_light.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 414e86b

Please sign in to comment.