Skip to content

Commit

Permalink
Fix #154 warning button "markers" not found
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic100 committed Oct 23, 2017
1 parent bb72816 commit 0e4f45d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/js/components/PSVHUD.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function PSVHUD(psv) {
this.prop = {
panelOpened: false,
panelOpening: false,
markersButton: this.psv.navbar.getNavbarButton('markers')
markersButton: this.psv.navbar.getNavbarButton('markers', true)
};

this.create();
Expand Down
5 changes: 3 additions & 2 deletions src/js/components/PSVNavBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@ PSVNavBar.prototype.destroy = function() {
/**
* @summary Returns a button by its identifier
* @param {string} id
* @param {boolean} [silent=false]
* @returns {module:components/buttons.PSVNavBarButton}
*/
PSVNavBar.prototype.getNavbarButton = function(id) {
PSVNavBar.prototype.getNavbarButton = function(id, silent) {
var button = null;

this.items.some(function(item) {
Expand All @@ -145,7 +146,7 @@ PSVNavBar.prototype.getNavbarButton = function(id) {
}
});

if (!button) {
if (!button && !silent) {
console.warn('PhotoSphereViewer: button "' + id + '" not found in the navbar.');
}

Expand Down

0 comments on commit 0e4f45d

Please sign in to comment.