- me.addTool([{
- type: 'minus',
- disabled: true,
- tooltip: gettext('Undo Zoom'),
- handler: function(){
- var undoButton = me.interactions[0].getUndoButton();
- if (undoButton.handler) {
- undoButton.handler();
- }
- }
- },{
- type: 'restore',
- tooltip: gettext('Toggle Legend'),
- handler: function(){
- me.legend.setVisible(!me.legend.isVisible());
- }
- }]);
+ me.updateHeader();
+
+ if (me.header && me.legend) {
+ me.header.padding = '4 9 4';
+ me.header.add(me.legend);
+ }
+
+ if (!me.noTool) {
+ me.addTool({
+ type: 'minus',
+ disabled: true,
+ tooltip: gettext('Undo Zoom'),
+ handler: function() {
+ let undoButton = me.interactions[0].getUndoButton();
+ if (undoButton.handler) {
+ undoButton.handler();
+ }
+ },
+ });
+ }
+