diff --git a/htdocs/lib/AprsMarker.js b/htdocs/lib/AprsMarker.js index aa3210a..d31dadd 100644 --- a/htdocs/lib/AprsMarker.js +++ b/htdocs/lib/AprsMarker.js @@ -8,7 +8,7 @@ AprsMarker.prototype.draw = function() { if (!div || !overlay) return; if (this.symbol) { - var tableId = this.symbol.table == '/' ? 0 : 1; + var tableId = this.symbol.table === '/' ? 0 : 1; div.style.background = 'url(/aprs-symbols/aprs-symbols-24-' + tableId + '@2x.png)'; div.style['background-size'] = '384px 144px'; div.style['background-position-x'] = -(this.symbol.index % 16) * 24 + 'px'; @@ -25,7 +25,7 @@ AprsMarker.prototype.draw = function() { div.style.transform = null; } - if (this.symbol.table != '/' && this.symbol.table != '\\') { + if (this.symbol.table !== '/' && this.symbol.table !== '\\') { overlay.style.display = 'block'; overlay.style['background-position-x'] = -(this.symbol.tableindex % 16) * 24 + 'px'; overlay.style['background-position-y'] = -Math.floor(this.symbol.tableindex / 16) * 24 + 'px'; diff --git a/htdocs/lib/BookmarkBar.js b/htdocs/lib/BookmarkBar.js index 43f7213..4edac8e 100644 --- a/htdocs/lib/BookmarkBar.js +++ b/htdocs/lib/BookmarkBar.js @@ -31,7 +31,7 @@ function BookmarkBar() { me.loadLocalBookmarks(); }); - var $bookmarkButton = $('#openwebrx-panel-receiver .openwebrx-bookmark-button'); + var $bookmarkButton = $('#openwebrx-panel-receiver').find('.openwebrx-bookmark-button'); if (typeof(Storage) !== 'undefined') { $bookmarkButton.show(); } else { @@ -56,10 +56,10 @@ function BookmarkBar() { BookmarkBar.prototype.position = function(){ var range = get_visible_freq_range(); - $('#openwebrx-bookmarks-container .bookmark').each(function(){ + $('#openwebrx-bookmarks-container').find('.bookmark').each(function(){ $(this).css('left', scale_px_from_freq($(this).data('frequency'), range)); }); -} +}; BookmarkBar.prototype.loadLocalBookmarks = function(){ var bwh = bandwidth / 2; @@ -69,7 +69,7 @@ BookmarkBar.prototype.loadLocalBookmarks = function(){ return b.frequency >= start && b.frequency <= end; }); this.replace_bookmarks(bookmarks, 'local', true); -} +}; BookmarkBar.prototype.replace_bookmarks = function(bookmarks, source, editable) { editable = !!editable; @@ -80,13 +80,13 @@ BookmarkBar.prototype.replace_bookmarks = function(bookmarks, source, editable) }); this.bookmarks[source] = bookmarks; this.render(); -} +}; BookmarkBar.prototype.render = function(){ var bookmarks = Object.values(this.bookmarks).reduce(function(l, v){ return l.concat(v); }); bookmarks = bookmarks.sort(function(a, b){ return a.frequency - b.frequency; }); var elements = bookmarks.map(function(b){ - $bookmark = $( + var $bookmark = $( '