Sha256: fa64510b4fbd870992bc03624a6dbc2084313fc5735924fa721248642af0c4b6

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

/* global _ */
"use strict";
import "lodash/lodash";

import GrepContainer from "./grep_container";

$(document).ready(() => {
  new Vue({
    el: "#filter-grep-setting",
    components: {
      "grep-container": GrepContainer,
    },
    data: function() {
      return {
        containers: {
          and: [true],
          or: [true]
        }
      };
    },
    mounted: function() {
      this.$on("add-grep-container", this.addGrepContainer);
      this.$on("remove-grep-container", this.removeGrepContainer);
    },
    methods: {
      addGrepContainer: function(containerType, index) {
        const found = this.containers[containerType].indexOf(false);
        if (found < 0) {
          this.$set(this.containers[containerType], this.containers[containerType].length, true);
        } else {
          this.$set(this.containers[containerType], found, true);
        }
      },
      removeGrepContainer: function(containerType, index) {
        this.$set(this.containers[containerType], index, false);
      }
    }
  });
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fluentd-ui-1.1.0 app/javascript/packs/filter_grep_setting.js