Skip to content

Commit

Permalink
Improve user experience
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelTallet committed Apr 22, 2021
1 parent 9ea7422 commit 860c49e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
19 changes: 7 additions & 12 deletions source/parametric_modeling/HTML Dialogs/nodes-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1709,6 +1709,13 @@ PMG.NodesEditor.loadToolbarIcons = () => {

PMG.NodesEditor.adaptNumberInputStep = input => {

if ( input.value === '' ) {

input.step = 1
return

}

if ( isNaN(parseFloat(input.step)) ) {
input.step = 1
}
Expand Down Expand Up @@ -1938,14 +1945,6 @@ PMG.NodesEditor.showOrHideMinimap = () => {

}

PMG.NodesEditor.resetNumberInputsStep = () => {

document.querySelectorAll('input[type="number"]').forEach(numberInputElement => {
numberInputElement.step = 1
})

}

PMG.NodesEditor.setGlobalContextMenu = () => {

var contextMenuOptions = [
Expand All @@ -1965,10 +1964,6 @@ PMG.NodesEditor.setGlobalContextMenu = () => {
name: t('Show or hide minimap'),
fn: () => { PMG.NodesEditor.showOrHideMinimap() }
},
{
name: t('Reset increment values'),
fn: () => { PMG.NodesEditor.resetNumberInputsStep() }
},
{
name: t('Remove all nodes'),
fn: () => { PMG.NodesEditor.editor.clear() }
Expand Down
1 change: 0 additions & 1 deletion source/parametric_modeling/Resources/fr/pmg.translation
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@
"Export schema to a file"="Exporter le schéma vers un fichier";
"Freeze parametric entities"="Geler les entités paramétriques";
"Show or hide minimap"="Afficher ou masquer la mini-carte";
"Reset increment values"="Réinitialiser les valeurs d'incrément";
"Remove all nodes"="Supprimer tous les nœuds";
"Access online help"="Accéder à l'aide en ligne";
"Error: Nodes Editor schema is incompatible."="Erreur : Le schéma de l'éditeur de nœuds est incompatible.";
Expand Down
1 change: 0 additions & 1 deletion source/parametric_modeling/nodes_editor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ def self.translation
"Export schema to a file": TRANSLATE['Export schema to a file'],
"Freeze parametric entities": TRANSLATE['Freeze parametric entities'],
"Show or hide minimap": TRANSLATE['Show or hide minimap'],
"Reset increment values": TRANSLATE['Reset increment values'],
"Remove all nodes": TRANSLATE['Remove all nodes']

}
Expand Down

0 comments on commit 860c49e

Please sign in to comment.