Skip to content

Commit

Permalink
Merge pull request #117 from samuelyeshua/master
Browse files Browse the repository at this point in the history
Modifies the call obsolete electron to a recent version
  • Loading branch information
zeke authored Feb 24, 2017
2 parents 5a1a8ef + f909a49 commit ba7b496
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 31 deletions.
18 changes: 10 additions & 8 deletions dist/template-app/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var app = require('app'); // Module to control application life.
var BrowserWindow = require('browser-window'); // Module to create native browser window.
// {app} Module to control application life.
// {BrowserWindow} Module to create native browser window.
const {app, BrowserWindow} = require('electron')

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
Expand All @@ -19,12 +20,13 @@ app.on('window-all-closed', function() {
app.on('ready', function() {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 600,
height: 300,
'min-width': 500,
'min-height': 200,
'accept-first-mouse': true,
'title-bar-style': 'hidden'
width: 800,
height: 600,
minWidth: 500,
minHeight: 200,
acceptFirstMouse: true,
titleBarStyle: 'hidden',
frame: false
});

// and load the index.html of the app.
Expand Down
36 changes: 18 additions & 18 deletions dist/template-app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,109 +65,109 @@ <h5 class="nav-group-title">Favorites</h5>
</tr>
</thead>
<tbody>
<tr>
<tr class="file_arq">
<td>bars.scss</td>
<td>Document</td>
<td>Oct 13, 2015</td>
<td>connors</td>
</tr>
<tr>
<tr class="file_arq">
<td>base.scss</td>
<td>Document</td>
<td>Oct 13, 2015</td>
<td>connors</td>
</tr>
<tr>
<tr class="file_arq">
<td>button-groups.scss</td>
<td>Document</td>
<td>Oct 13, 2015</td>
<td>connors</td>
</tr>
<tr>
<tr class="file_arq">
<td>buttons.scss</td>
<td>Document</td>
<td>Oct 13, 2015</td>
<td>connors</td>
</tr>
<tr>
<tr class="file_arq">
<td>docs.scss</td>
<td>Document</td>
<td>Oct 13, 2015</td>
<td>connors</td>
</tr>
<tr>
<tr class="file_arq">
<td>forms.scss</td>
<td>Document</td>
<td>Oct 13, 2015</td>
<td>connors</td>
</tr>
<tr>
<tr class="file_arq">
<td>grid.scss</td>
<td>Document</td>
<td>Oct 13, 2015</td>
<td>connors</td>
</tr>
<tr>
<tr class="file_arq">
<td>icons.scss</td>
<td>Document</td>
<td>Oct 13, 2015</td>
<td>connors</td>
</tr>
<tr>
<tr class="file_arq">
<td>images.scss</td>
<td>Document</td>
<td>Oct 13, 2015</td>
<td>connors</td>
</tr>
<tr>
<tr class="file_arq">
<td>lists.scss</td>
<td>Document</td>
<td>Oct 13, 2015</td>
<td>connors</td>
</tr>
<tr>
<tr class="file_arq">
<td>mixins.scss</td>
<td>Document</td>
<td>Oct 13, 2015</td>
<td>connors</td>
</tr>
<tr>
<tr class="file_arq">
<td>navs.scss</td>
<td>Document</td>
<td>Oct 13, 2015</td>
<td>connors</td>
</tr>
<tr>
<tr class="file_arq">
<td>normalize.scss</td>
<td>Document</td>
<td>Oct 13, 2015</td>
<td>connors</td>
</tr>
<tr>
<tr class="file_arq">
<td>photon.scss</td>
<td>Document</td>
<td>Oct 13, 2015</td>
<td>connors</td>
</tr>
<tr>
<tr class="file_arq">
<td>tables.scss</td>
<td>Document</td>
<td>Oct 13, 2015</td>
<td>connors</td>
</tr>
<tr>
<tr class="file_arq">
<td>tabs.scss</td>
<td>Document</td>
<td>Oct 13, 2015</td>
<td>connors</td>
</tr>
<tr>
<tr class="file_arq">
<td>utilities.scss</td>
<td>Document</td>
<td>Oct 13, 2015</td>
<td>connors</td>
</tr>
<tr>
<tr class="file_arq">
<td>variables.scss</td>
<td>Document</td>
<td>Oct 13, 2015</td>
Expand Down
18 changes: 13 additions & 5 deletions dist/template-app/js/menu.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
var remote = require('remote')
var Menu = remote.require('menu')
var MenuItem = remote.require('menu-item')
// var remote = require('remote')
// var Menu = remote.require('menu')
// var MenuItem = remote.require('menu-item')
const {remote} = require('electron')
const {Menu,MenuItem} = remote

// Build our new menu
var menu = new Menu()
Expand All @@ -21,7 +23,13 @@ menu.append(new MenuItem({

// Add the listener
document.addEventListener('DOMContentLoaded', function () {
document.querySelector('.js-context-menu').addEventListener('click', function (event) {
menu.popup(remote.getCurrentWindow());

let filesContext = document.querySelectorAll('.file_arq');

filesContext.forEach(function(el){
el.addEventListener('click', function (event) {
event.preventDefault()
menu.popup(remote.getCurrentWindow());
})
})
})

0 comments on commit ba7b496

Please sign in to comment.