Skip to content

Commit

Permalink
Fix linting issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
green3g committed Oct 9, 2016
1 parent 8b0b592 commit ab1c132
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 15 deletions.
36 changes: 24 additions & 12 deletions viewer/js/config/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,20 @@ define([
}

//some example topics for listening to menu item clicks
topic.subscribe('layerControl/hello', function(event){
alert(event.layer._titleForLegend + ' ' + event.subLayer.name + ' says hello');
//these topics publish a simple message to the growler
//in a real world example, these topics would be used
//in their own widget to listen for layer menu click events
topic.subscribe('layerControl/hello', function (event) {
topic.publish('growler/growl', {
title: 'Hello!',
message: event.layer._titleForLegend + ' ' + event.subLayer.name + ' says hello'
});
});
topic.subscribe('layerControl/goodbye', function(event){
alert(event.layer._titleForLegend + ' ' + event.subLayer.name + ' says goodbye');
topic.subscribe('layerControl/goodbye', function (event) {
topic.publish('growler/growl', {
title: 'Goodbye!',
message: event.layer._titleForLegend + ' ' + event.subLayer.name + ' says goodbye'
});
});

return {
Expand Down Expand Up @@ -196,9 +205,9 @@ define([

//override the menu on this particular layer
menu: [{
topic: 'hello',
label: 'Say Hello',
iconClass: 'fa fa-smile-o'
topic: 'hello',
label: 'Say Hello',
iconClass: 'fa fa-smile-o'
}]
}
/*
Expand Down Expand Up @@ -408,12 +417,15 @@ define([
separated: true,
vectorReorder: true,
overlayReorder: true,

//create a example sub layer menu that will
//apply to all layers of type 'dynamic'
subLayerMenu: {
dynamic: [{
topic: 'goodbye',
iconClass: 'fa fa-frown-o',
label: 'Say goodbye'
}]
dynamic: [{
topic: 'goodbye',
iconClass: 'fa fa-frown-o',
label: 'Say goodbye'
}]
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions viewer/js/gis/dijit/LayerControl/controls/Dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ define([
}

// add custom sublayer menu items if we only have one sublayer
if(!this._hasSublayers){
array.forEach(this.controlOptions.menu, lang.hitch(this, '_addMenuItem', menu));
if (!this._hasSublayers) {
array.forEach(this.controlOptions.menu, lang.hitch(this, '_addMenuItem', menu));
}
},
_addMenuItem: function (menu, menuItem) {
Expand Down
2 changes: 1 addition & 1 deletion viewer/js/gis/dijit/LayerControl/plugins/LayerMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ define([
}
}
});
});
});

0 comments on commit ab1c132

Please sign in to comment.