import {Component, OnInit, ViewChild} from '@angular/core';
import {FramePageComponent} from "../../../frame/core/page/frame.page";
import {BsModalService} from "ngx-bootstrap/modal";
import { AjaxService } from '../../../../core/service/ajax.service';
import { MsgService } from '../../../../core/service/msg.service';
import {CfAuthTagDetailComponent} from '../authtag-detail/authtag-detail.component';
import { FramePager } from '../../../../core/frame/pager/frame-pager/frame-pager';

declare var $: any;

@Component({
  selector: 'app-cf-authtag-page',
  templateUrl: './authtag-page.component.html',
  styleUrls: ['./authtag-page.component.scss']
})
export class CfAuthTagPageComponent extends FramePageComponent implements OnInit {

  query = {
    school_id : ''
  };

  constructor(private modalService: BsModalService) {
    super(modalService);
    this.modalComponent = CfAuthTagDetailComponent;
  }

  ngOnInit() {
    let _this = this;
    setInterval(function() {
      for (var i=0; i< _this.pager.getRecords().length; i++) {
        let v = _this.pager.getRecords()[i];
        $("#span" + v.tag_id).css("background-color", v.tag_color);
      }
    }, 500);
  }

}
