Fix callback function bind with object as parameter (#7984)
Signed-off-by: TAY TS <taytzushieh@gmail.com>
This commit is contained in:
parent
f0d87b5d86
commit
c9d827c1d0
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue