home tab activation

t Please enter the commit message for your changes. Lines starting
pull/1/head
LianaHus 6 years ago
parent b0a3f7545f
commit 086db97fcb
  1. 39
      src/app/components/vertical-icons.js
  2. 9
      src/app/ui/landing-page/landing-page.js
  3. 2
      src/framingService.js

@ -196,11 +196,19 @@ export class VerticalIcons {
* @param {string} name Name of profile of the module to activate * @param {string} name Name of profile of the module to activate
*/ */
select (name) { select (name) {
this.removeActive() this.updateActivations(name)
this.addActive(name)
this.events.emit('showContent', name) this.events.emit('showContent', name)
} }
updateActivations(name) {
if (name === "home") {
this.activateHome()
} else {
this.removeActive()
this.addActive(name)
}
}
onThemeChanged (themeType) { onThemeChanged (themeType) {
const invert = themeType === 'dark' ? 1 : 0 const invert = themeType === 'dark' ? 1 : 0
const active = this.view.querySelector(`.${css.active}`) const active = this.view.querySelector(`.${css.active}`)
@ -211,17 +219,20 @@ export class VerticalIcons {
} }
_iconClick (name) { _iconClick (name) {
this.removeActive() this.updateActivations(name)
this.addActive(name)
this.events.emit('toggleContent', name) this.events.emit('toggleContent', name)
} }
activateHome() {
globalRegistry.get('appmanager').api.ensureActivated('home')
}
render () { render () {
let home = yo` let home = yo`
<div <div
class="${css.homeIcon}" class="${css.homeIcon}"
onclick="${(e) => { onclick="${(e) => {
globalRegistry.get('appmanager').api.ensureActivated('home') this.activateHome()
}}" }}"
plugin="${this.homeProfile.name}" title="${this.homeProfile.displayName}" plugin="${this.homeProfile.name}" title="${this.homeProfile.displayName}"
> >
@ -345,15 +356,15 @@ export class VerticalIcons {
this.view = yo` this.view = yo`
<div class=${css.icons}> <div class=${css.icons}>
${home} ${home}
${this.iconKind['fileexplorer']} ${this.iconKind['fileexplorer']}
${this.iconKind['compile']} ${this.iconKind['compile']}
${this.iconKind['run']} ${this.iconKind['run']}
${this.iconKind['testing']} ${this.iconKind['testing']}
${this.iconKind['analysis']} ${this.iconKind['analysis']}
${this.iconKind['debugging']} ${this.iconKind['debugging']}
${this.iconKind['other']} ${this.iconKind['other']}
${this.iconKind['settings']} ${this.iconKind['settings']}
</div> </div>
` `
return this.view return this.view

@ -96,9 +96,12 @@ export class LandingPage extends BaseApi {
let load = function (service, item, examples, info) { let load = function (service, item, examples, info) {
let compilerImport = new CompilerImport() let compilerImport = new CompilerImport()
let fileProviders = globalRegistry.get('fileproviders').api let fileProviders = globalRegistry.get('fileproviders').api
const msg = yo`<div class="p-2"><span>Enter the ${item} you would like to load.</span> const msg = yo`
<div>${info}</div> <div class="p-2">
<div>e.g ${examples.map((url) => { return yo`<div class="p-1"><a>${url}</a></div>` })}</div></div>` <span>Enter the ${item} you would like to load.</span>
<div>${info}</div>
<div>e.g ${examples.map((url) => { return yo`<div class="p-1"><a>${url}</a></div>` })}</div>
</div>`
modalDialogCustom.prompt(`Import from ${service}`, msg, null, (target) => { modalDialogCustom.prompt(`Import from ${service}`, msg, null, (target) => {
if (target !== '') { if (target !== '') {

@ -11,7 +11,7 @@ export default {
}) })
verticalIcon.select('fileExplorers') verticalIcon.select('fileExplorers')
mainPanel.showContent('home') verticalIcon.select('home')
document.addEventListener('keypress', (e) => { document.addEventListener('keypress', (e) => {
if (e.shiftKey && e.ctrlKey) { if (e.shiftKey && e.ctrlKey) {

Loading…
Cancel
Save