Skip to content

Commit

Permalink
examples.component.helix.Viewport: afterSetShowGitHubStarButton() #5454
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiu committed Jun 22, 2024
1 parent 7cc8ff6 commit 8c3392a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
5 changes: 3 additions & 2 deletions apps/portal/view/home/parts/CoolStuff.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ class CoolStuff extends Container {
"",
"class MainView extends Viewport {",
" static config = {",
" className: 'Portal.view.MultiWindowHelix',",
" theme : 'neo-theme-dark'",
" className : 'Portal.view.MultiWindowHelix',",
" showGitHubStarButton: false,",
" theme : 'neo-theme-dark'",
" }",
"}",
"",
Expand Down
20 changes: 16 additions & 4 deletions examples/component/helix/Viewport.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ class Viewport extends BaseViewport {
*/
layout: {ntype: 'hbox', align: 'stretch'},
/**
* @member {Boolean} showGitHubStarButton=true
* @member {Boolean} showGitHubStarButton_=true
*/
showGitHubStarButton: true,
showGitHubStarButton_: true,
/**
* @member {Object[]} items
*/
Expand All @@ -66,8 +66,10 @@ class Viewport extends BaseViewport {
zIndex : 1
}
}, {
ntype: 'component',
html : '<a class="github-button" href="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/neomjs/neo" data-size="large" data-show-count="true" aria-label="Star neomjs/neo on GitHub">Star</a>',
ntype : 'component',
html : '<a class="github-button" href="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/neomjs/neo" data-size="large" data-show-count="true" aria-label="Star neomjs/neo on GitHub">Star</a>',
reference: 'github-button',

style: {
position: 'absolute',
right : '20px',
Expand Down Expand Up @@ -280,6 +282,16 @@ class Viewport extends BaseViewport {
}, 200)
}
}

/**
* Triggered after the showGitHubStarButton config got changed
* @param {Boolean} value
* @param {Boolean} oldValue
* @protected
*/
afterSetShowGitHubStarButton(value, oldValue) {
this.getItem('github-button').hidden = !value;
}
}

Neo.setupClass(Viewport);
Expand Down

0 comments on commit 8c3392a

Please sign in to comment.