本文整理汇总了TypeScript中app/core/core.Emitter类的典型用法代码示例。如果您正苦于以下问题:TypeScript Emitter类的具体用法?TypeScript Emitter怎么用?TypeScript Emitter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Emitter类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: it
it('when subscribing twice', () => {
var events = new Emitter();
var sub1Called = 0;
function handler() {
sub1Called += 1;
}
events.on('test', handler);
events.on('test', handler);
events.emit('test', null);
expect(sub1Called).to.be(2);
});
开发者ID:PaulMest,项目名称:grafana,代码行数:15,代码来源:emitter_specs.ts
示例2: initEditMode
initEditMode() {
if (!this.editModeInitiated) {
this.editModeInitiated = true;
this.events.emit('init-edit-mode', null);
this.maxPanelsPerRowOptions = getFactors(GRID_COLUMN_COUNT);
}
}
开发者ID:CorpGlory,项目名称:grafana,代码行数:7,代码来源:panel_ctrl.ts
示例3: getExtendedMenu
getExtendedMenu() {
const menu = [];
if (!this.panel.fullscreen && this.dashboard.meta.canEdit) {
menu.push({
text: 'Duplicate',
click: 'ctrl.duplicate()',
role: 'Editor',
shortcut: 'p d',
});
menu.push({
text: 'Copy',
click: 'ctrl.copyPanel()',
role: 'Editor',
});
}
menu.push({
text: 'Panel JSON',
click: 'ctrl.editPanelJson(); dismiss();',
});
this.events.emit('init-panel-actions', menu);
return menu;
}
开发者ID:CorpGlory,项目名称:grafana,代码行数:25,代码来源:panel_ctrl.ts
示例4: render
render(payload?) {
// ignore if other panel is in fullscreen mode
if (this.otherPanelInFullscreenMode()) {
return;
}
this.events.emit('render', payload);
}
开发者ID:ArtyomyuS,项目名称:grafana,代码行数:8,代码来源:panel_ctrl.ts
示例5: init
init() {
this.calculatePanelHeight();
this.publishAppEvent('panel-initialized', {scope: this.$scope});
this.events.emit('panel-initialized');
this.refresh();
}
开发者ID:1tylermitchell,项目名称:grafana,代码行数:8,代码来源:panel_ctrl.ts
示例6: render
render(payload?) {
// ignore if other panel is in fullscreen mode
if (this.otherPanelInFullscreenMode()) {
return;
}
this.calculatePanelHeight();
this.timing.renderStart = new Date().getTime();
this.events.emit('render', payload);
}
开发者ID:mtanda,项目名称:grafana,代码行数:10,代码来源:panel_ctrl.ts
示例7: refresh
refresh() {
if (!this.isPanelVisible() && !this.dashboard.meta.soloMode && !this.dashboard.snapshot) {
this.skippedLastRefresh = true;
return;
}
this.skippedLastRefresh = false;
this.events.emit('refresh', null);
}
开发者ID:martinwalsh,项目名称:grafana,代码行数:10,代码来源:panel_ctrl.ts
示例8: initEditMode
initEditMode() {
this.editorTabs = [];
this.addEditorTab('General', 'public/app/partials/panelgeneral.html');
this.editModeInitiated = true;
this.events.emit('init-edit-mode', null);
var urlTab = (this.$injector.get('$routeParams').tab || '').toLowerCase();
if (urlTab) {
this.editorTabs.forEach((tab, i) => {
if (tab.title.toLowerCase() === urlTab) {
this.editorTabIndex = i;
}
});
}
}
开发者ID:mtanda,项目名称:grafana,代码行数:15,代码来源:panel_ctrl.ts
注:本文中的app/core/core.Emitter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论