<commit_before>import Ember from 'ember';
import layout from '../templates/components/flexberry-maptoolbar';
import draggingTool from 'ember-flexberry-gis/maptools/dragging';

const { getOwner } = Ember;

export default Ember.Component.extend({
  layout,

  leafletMap: null,

  activeTool: null,

  activeToolName: null,

  _isMeasureTool(toolname) {
    return toolname && toolname.substr(-11) ===  'measuretool';
  },

  actions: {

    activateTool(toolname) {
      let activeToolName = this.get('activeToolName');
      if (toolname == '+' && this._isMeasureTool(activeToolName)) {
        toolname = activeToolName;
      } else {
        if(!this._isMeasureTool(toolname) && toolname === activeToolName) {
          return;
        }
      }

      let tool = getOwner(this).lookup('maptool:' + toolname);
      let leafletMap = this.get('leafletMap');
      if (tool && leafletMap) {
        let activeTool = this.get('activeTool');
        if(!activeTool && leafletMap.dragging.enabled())
        {
          activeTool = draggingTool.create({ map: leafletMap });
        }

        tool.set('map', leafletMap);

        if (activeTool && !this._isMeasureTool(activeToolName)) {
          activeTool.disable();
        }<commit_msg>JSCS incomatilities<commit_after>import Ember from 'ember';
import layout from '../templates/components/flexberry-maptoolbar';
import draggingTool from 'ember-flexberry-gis/maptools/dragging';

const { getOwner } = Ember;

export default Ember.Component.extend({
  layout,

  leafletMap: null,

  activeTool: null,

  activeToolName: null,

  _isMeasureTool(toolname) {
    return toolname && toolname.substr(-11) ===  'measuretool';
  },

  actions: {

    activateTool(toolname) {
      let activeToolName = this.get('activeToolName');
      if (toolname === '+' && this._isMeasureTool(activeToolName)) {
        toolname = activeToolName;
      } else {
        if(!this._isMeasureTool(toolname) && toolname === activeToolName) {
          return;
        }
      }

      let tool = getOwner(this).lookup('maptool:' + toolname);
      let leafletMap = this.get('leafletMap');
      if (tool && leafletMap) {
        let activeTool = this.get('activeTool');
        if(!activeTool && leafletMap.dragging.enabled())
        {
          activeTool = draggingTool.create({ map: leafletMap });
        }

        tool.set('map', leafletMap);

        if (activeTool && !this._isMeasureTool(activeToolName)) {
          activeTool.disable();
        }
{'fraction_non_alphanumeric': 0.13528703331995182, 'fraction_numerical': 0.0016057808109193096, 'mean_word_length': 2.9182389937106916, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3211335', 'n_tokens_mistral': 761, 'n_tokens_neox': 745, 'n_words': 141}