Files
phabricator/webroot/rsrc/js/application/dashboard/behavior-dashboard-async-panel.js
epriestley 63acd90cef Allow dashboard panels to detect rendering cycles and arrest stack overflows
Summary:
Ref T4986. Ref T4983. Panels will soon be able to contain other panels, either via Remarkup (`{W1}`) or maybe through new types of meta-panels.

Allow panels to detect that they are being rendered very deeply and/or within themselves.

Test Plan: Faked some errors, got failed panel renders. Since panels can't //really// contain other panels yet, this doesn't really have an impact.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: chad, epriestley

Maniphest Tasks: T4983, T4986

Differential Revision: https://secure.phabricator.com/D9140
2014-05-15 19:21:36 -07:00

19 lines
474 B
JavaScript

/**
* @provides javelin-behavior-dashboard-async-panel
* @requires javelin-behavior
* javelin-dom
* javelin-workflow
*/
JX.behavior('dashboard-async-panel', function(config) {
var panel = JX.$(config.panelID);
panel.style.opacity = '0.5';
new JX.Workflow(config.uri)
.setData({parentPanelPHIDs: config.parentPanelPHIDs.join(',')})
.setHandler(function(r) {
JX.DOM.replace(panel, JX.$H(r.panelMarkup));
})
.start();
});