diff options
| author | Kumar Priyansh <[email protected]> | 2020-07-17 21:55:48 +0530 |
|---|---|---|
| committer | Kumar Priyansh <[email protected]> | 2020-07-17 21:55:48 +0530 |
| commit | 672dc896b139801bf454c51c9e61e2dd61932712 (patch) | |
| tree | 0911f47917d60827617d0b3dc3baba23c6e357ac /src/scripts/starterWindow.js | |
| parent | 431512a9625dea403afea32bb4d9b6f426fed4a5 (diff) | |
| download | authorr-672dc896b139801bf454c51c9e61e2dd61932712.tar.xz authorr-672dc896b139801bf454c51c9e61e2dd61932712.zip | |
Function to load Template URLs in Window
Diffstat (limited to 'src/scripts/starterWindow.js')
| -rw-r--r-- | src/scripts/starterWindow.js | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/scripts/starterWindow.js b/src/scripts/starterWindow.js index 0f20eca..dd21624 100644 --- a/src/scripts/starterWindow.js +++ b/src/scripts/starterWindow.js @@ -1,4 +1,9 @@ +const remote = require('electron').remote; + $(document).ready(function () { + var monitorWidth = screen.width; + var monitorHeight = screen.height; + $('.nav-group').on('click', 'span', function () { $('.nav-group span.active').removeClass('active'); $(this).addClass('active'); @@ -25,13 +30,22 @@ $(document).ready(function () { else { showError('No Template Selected!', 'No template was selected. Please Select a template to get started!') } - }) + }); + $('#cancelSelected').click(function () { + var window = remote.getCurrentWindow(); + window.close(); + }); function showError(heading, message) { const { remote } = window.require('electron') const dialog = remote.dialog dialog.showErrorBox(heading, message); } function start(id) { - alert('This would start the ' + id + ' template'); + var templateURL = 'file://' + __dirname + `/templates/${id}.html`; + var window = remote.getCurrentWindow(); + + window.setSize(monitorWidth * 0.75, monitorHeight * 0.75, false); + window.center(); + window.loadURL(templateURL); } })
\ No newline at end of file |
