'use strict';

module.exports = [ 'ViewsProvider', function(ViewsProvider) {
  ViewsProvider.registerDefaultView('cockpit.navigation', {
    id: 'batch',
    label: 'Batches',
    pagePath: '#/batch',
    template: '<!-- nothing to show, but needed -->',
    controller: function() {},
    checkActive: function(path) {
      return path && path.split('?')[0] && path.split('?')[0].endsWith('#/batch');
    },
    priority: -5
  });
}];

'use strict';

module.exports = [ 'ViewsProvider', function(ViewsProvider) {
  ViewsProvider.registerDefaultView('cockpit.navigation', {
    id: 'batch',
    label: 'Batches',
    pagePath: '#/batch',
    template: '<!-- nothing to show, but needed -->',
    controller: function() {},
    checkActive: function(path) {
      var ending = '#/batch';
      var parts = (path || '').split('?');
      return parts.length && (parts[0].slice(0 - ending.length) === ending);
    },
    priority: -5
  });
}];

replace ES6 function by something supported by IE