Skip to content

Commit

Permalink
Merge pull request #495 from FlowFuse/494-ui-page-visibility
Browse files Browse the repository at this point in the history
UI Path - Fix default path visibility & path value
  • Loading branch information
joepavitt authored Jan 17, 2024
2 parents 6875d7a + 53c4a3b commit 0c14e59
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions nodes/config/ui_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
required: true
},
path: {
value: '/',
value: -1,
required: false
},
icon: {
Expand All @@ -32,10 +32,21 @@
value: -1
},
className: { value: '' },
visible: { value: true },
disabled: { value: false }
visible: { value: 'true' },
disabled: { value: 'false' }
},
oneditprepare: function () {
if (this.path === -1) {
// we have no path set yet
let pageCount = 0
RED.nodes.eachConfig((cNode) => {
pageCount += cNode.type === 'ui-page' ? 1 : 0
})
this.path = '/page' + (pageCount + 1)
$('#node-config-input-path').val(this.path)
console.log('setting path to', this.path)
}

$('#node-config-input-layout').typedInput({
type: 'layout',
types: [{
Expand Down

0 comments on commit 0c14e59

Please sign in to comment.