當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript core.appEvents類代碼示例

本文整理匯總了TypeScript中app/core/core.appEvents的典型用法代碼示例。如果您正苦於以下問題:TypeScript appEvents類的具體用法?TypeScript appEvents怎麽用?TypeScript appEvents使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了appEvents類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: shareDashboard

    shareDashboard(tabIndex) {
      var modalScope = this.$scope.$new();
      modalScope.tabIndex = tabIndex;
      modalScope.dashboard = this.dashboard;

      appEvents.emit('show-modal', {
        src: 'public/app/features/dashboard/partials/shareModal.html',
        scope: modalScope
      });
    }
開發者ID:shirish87,項目名稱:grafana,代碼行數:10,代碼來源:dashnav.ts

示例2:

 elem.mouseleave(function() {
   if (panel.tooltip.shared) {
     let plot = elem.data().plot;
     if (plot) {
       $tooltip.detach();
       plot.unhighlight();
     }
   }
   appEvents.emit('graph-hover-clear');
 });
開發者ID:fangjianfeng,項目名稱:grafana,代碼行數:10,代碼來源:graph_tooltip.ts

示例3: shareDashboard

  shareDashboard(tabIndex) {
    const modalScope = this.$scope.$new();
    modalScope.tabIndex = tabIndex;
    modalScope.dashboard = this.dashboard;

    appEvents.emit('show-modal', {
      src: 'public/app/features/dashboard/components/ShareModal/template.html',
      scope: modalScope,
    });
  }
開發者ID:gnydick,項目名稱:grafana,代碼行數:10,代碼來源:DashNavCtrl.ts

示例4: delete

 delete(s) {
   appEvents.emit('confirm-modal', {
     title: 'Delete',
     text: 'Are you sure you want to delete this datasource?',
     yesText: "Delete",
     icon: "fa-trash",
     onConfirm: () => {
       this.confirmDelete();
     }
   });
 }
開發者ID:rbak1,項目名稱:grafana,代碼行數:11,代碼來源:ds_edit_ctrl.ts

示例5: constructor

  /** @ngInject */
  constructor(private $scope, private dashboardSrv, private $location, public playlistSrv) {
    appEvents.on('save-dashboard', this.saveDashboard.bind(this), $scope);

    if (this.dashboard.meta.isSnapshot) {
      var meta = this.dashboard.meta;
      this.titleTooltip = 'Created:  ' + moment(meta.created).calendar();
      if (meta.expires) {
        this.titleTooltip += '<br>Expires: &nbsp;' + moment(meta.expires).fromNow() + '<br>';
      }
    }
  }
開發者ID:xlson,項目名稱:grafana,代碼行數:12,代碼來源:dashnav.ts

示例6: constructor

  /** @ngInject */
  constructor(
    private $scope,
    private $rootScope,
    private dashboardSrv,
    private $location,
    private backendSrv,
    private contextSrv,
    navModelSrv) {
      this.navModel = navModelSrv.getDashboardNav(this.dashboard, this);

      appEvents.on('save-dashboard', this.saveDashboard.bind(this), $scope);
      appEvents.on('delete-dashboard', this.deleteDashboard.bind(this), $scope);

      if (this.dashboard.meta.isSnapshot) {
        var meta = this.dashboard.meta;
        this.titleTooltip = 'Created: &nbsp;' + moment(meta.created).calendar();
        if (meta.expires) {
          this.titleTooltip += '<br>Expires: &nbsp;' + moment(meta.expires).fromNow() + '<br>';
        }
      }
    }
開發者ID:PaulMest,項目名稱:grafana,代碼行數:22,代碼來源:dashnav.ts

示例7: addPanel

  addPanel() {
    appEvents.emit('smooth-scroll-top');
    if (this.dashboard.panels.length > 0 && this.dashboard.panels[0].type === 'add-panel') {
      return; // Return if the "Add panel" exists already
    }

    this.dashboard.addPanel({
      type: 'add-panel',
      gridPos: { x: 0, y: 0, w: 12, h: 9 },
      title: 'Panel Title',
    });
  }
開發者ID:xlson,項目名稱:grafana,代碼行數:12,代碼來源:dashnav.ts

示例8: addPanel

  addPanel() {
    appEvents.emit('dash-scroll', { animate: true, evt: 0 });

    if (this.dashboard.panels.length > 0 && this.dashboard.panels[0].type === 'add-panel') {
      return; // Return if the "Add panel" exists already
    }

    this.dashboard.addPanel({
      type: 'add-panel',
      gridPos: { x: 0, y: 0, w: 12, h: 8 },
      title: 'Panel Title',
    });
  }
開發者ID:gnydick,項目名稱:grafana,代碼行數:13,代碼來源:DashNavCtrl.ts

示例9: emitGraphHoverEvet

  function emitGraphHoverEvet(event) {
    let x = xScale.invert(event.offsetX - yAxisWidth).valueOf();
    let y = yScale.invert(event.offsetY);
    let pos = {
      pageX: event.pageX,
      pageY: event.pageY,
      x: x, x1: x,
      y: y, y1: y,
      panelRelY: null
    };

    // Set minimum offset to prevent showing legend from another panel
    pos.panelRelY = Math.max(event.offsetY / height, 0.001);

    // broadcast to other graph panels that we are hovering
    appEvents.emit('graph-hover', {pos: pos, panel: panel});
  }
開發者ID:PaulMest,項目名稱:grafana,代碼行數:17,代碼來源:rendering.ts

示例10: removeRow

  removeRow(row, force?) {
    var index = _.indexOf(this.rows, row);

    if (!row.panels.length || force) {
      this.rows.splice(index, 1);
      row.destroy();
      return;
    }

    appEvents.emit('confirm-modal', {
      title: 'Remove Row',
      text: 'Are you sure you want to remove this row?',
      icon: 'fa-trash',
      yesText: 'Delete',
      onConfirm: () => {
        this.rows.splice(index, 1);
        row.destroy();
      }
    });
  }
開發者ID:mtanda,項目名稱:grafana,代碼行數:20,代碼來源:model.ts


注:本文中的app/core/core.appEvents類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。