Unverified Commit c9d827c1 by TAY TS Committed by GitHub

Fix callback function bind with object as parameter (#7984)

Signed-off-by: 's avatarTAY TS <taytzushieh@gmail.com>
parent f0d87b5d
......@@ -937,9 +937,11 @@ Prometheus.Page.prototype.init = function() {
if (graphOptions.length === 0) {
graphOptions.push({});
}
var pageInstance = this;
graphOptions.forEach(this.addGraph, this);
$("#add_graph").click(this.addGraph.bind(this, {}));
$("#add_graph").click(function() {
pageInstance.addGraph({});
});
};
Prometheus.Page.prototype.parseURL = function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment