Skip to content

Commit 3b12df9

Browse files
authored
sound-editor.jsx -- add extra warning + flip bool
1 parent e5d3505 commit 3b12df9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/containers/sound-editor.jsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,8 @@ class SoundEditor extends React.Component {
586586
};
587587
vNumber.oninput = vNumber.onchange;
588588
}
589-
handleFormatMenu() {
589+
590+
function handleFormatMenu() {
590591
const genTitle = (text) => {
591592
const label = document.createElement("div");
592593
label.style = "font-weight: 500;font-size: 14px;margin-bottom: 5px;";
@@ -647,6 +648,9 @@ class SoundEditor extends React.Component {
647648
warning.style = "font-size:13px;opacity:0.5;";
648649
warningDiv.appendChild(warning);
649650

651+
const warningDiv2 = warning.cloneNode(true);
652+
warningDiv2.textContent = "If 'whole sound' is selected, all added audio will use the new sample rate";
653+
650654
const applicatorDiv = document.createElement("div");
651655
applicatorDiv.append(
652656
genCheckableLabel("this selection", "0", true),
@@ -660,10 +664,10 @@ class SoundEditor extends React.Component {
660664
checkable.firstChild.checked = false;
661665
}
662666
div.firstChild.checked = true;
663-
selectedForceRate = div.id == "0";
667+
selectedForceRate = div.id === "1";
664668
e.stopPropagation();
665669
});
666-
menu.textarea.append(rateTitle, warningDiv, genTitle("Apply to:"), applicatorDiv);
670+
menu.textarea.append(rateTitle, warningDiv, genTitle("Apply to:"), applicatorDiv, warningDiv2);
667671
}
668672

669673
// TODO: use actual scratch-gui menus instead of this

0 commit comments

Comments
 (0)