Optimized stopping the scanner.
This commit is contained in:
parent
6d6b8c7d16
commit
95fb8b8dda
|
|
@ -109,3 +109,8 @@ Scanner.prototype.toggle = function() {
|
|||
// Toggle based on the current timer state
|
||||
return this.timer? this.stop() : this.start();
|
||||
};
|
||||
|
||||
Scanner.prototype.isRunning = function() {
|
||||
// Return current state
|
||||
return this.timer != null;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1722,10 +1722,14 @@ function toggleSpectrum() {
|
|||
}
|
||||
|
||||
function stopScanner() {
|
||||
var $scanButton = $('.openwebrx-squelch-auto');
|
||||
$scanButton.css('animation-name', '');
|
||||
$scanButton.removeClass('highlighted');
|
||||
scanner.stop();
|
||||
if (scanner.isRunning()) {
|
||||
// Stop scanner
|
||||
scanner.stop();
|
||||
// Modify scanner button state
|
||||
var $scanButton = $('.openwebrx-squelch-auto');
|
||||
$scanButton.css('animation-name', '');
|
||||
$scanButton.removeClass('highlighted');
|
||||
}
|
||||
}
|
||||
|
||||
function toggleScanner() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue