This commit is contained in:
ymq1 2025-06-27 14:06:08 +08:00
parent 29e3fab227
commit 454f30a345
3 changed files with 4 additions and 5 deletions

View File

@ -167,11 +167,12 @@ bricks.AudioRecorder = class extends bricks.HBox {
}
}
rec_btn_pressed(){
bricks.debug(this.rec_btn.url, ':url:', this.start_icon, this.stop_icon);
if(this.rec_btn.url == this.start_icon){
console.log('start recording .......');
this.rec_btn.set_url(this.stop_icon);
this.start_recording();
} else {
console.log('stop recording ....');
this.rec_btn.set_url(this.start_icon);
this.stop_recording();
}
@ -216,9 +217,6 @@ bricks.AudioRecorder = class extends bricks.HBox {
}
start_recording(){
this.recordData = null;
if( this.recordData ){
this.URL.revokeObjectURL(this.recordData.url);
}
if (this.mic_opened){
this.rec.start();
this.dispatch('record_started');

View File

@ -28,6 +28,7 @@ bricks.Svg = class extends bricks.VBox {
}
}
set_url(url){
this.url = url;
fetch(url)
.then(response => response.text())
.then(svgText => {

View File

@ -115,7 +115,7 @@ bricks.TreeNode = class extends bricks.VBox {
widget.add_widget(this.check_w);
this.check_w.bind('changed', this.tree.node_checked.bind(this.tree, this))
}
var icon_url = self.this.icons_urls.leaf;
var icon_url = this.icons_urls.leaf;
if (this.is_leaf) icon_url = this.icons_urls.leaf;
else if (this.node_state == 'expand') this.icon_url = this.icons_urls.open;
else this.icon_url = this.icons_urls.close;