mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2026-07-12 08:39:19 +00:00
[fix] http should bind this and not this.oReq
This commit is contained in:
9
http.js
9
http.js
@@ -21,10 +21,11 @@ function Http() {
|
||||
|
||||
Http.prototype.addEventListener = function(e, f) {
|
||||
this._events[e] = f;
|
||||
var self = this;
|
||||
switch (e) {
|
||||
case 'loadend':
|
||||
{
|
||||
this.oReq.addEventListener('loadend', function() {
|
||||
self.oReq.addEventListener('loadend', function() {
|
||||
if (this.status == 401) {
|
||||
var req = new XMLHttpRequest();
|
||||
for (key in this.http._events) {
|
||||
@@ -34,15 +35,15 @@ Http.prototype.addEventListener = function(e, f) {
|
||||
req.open(this.http._method, this.http._url);
|
||||
req.send();
|
||||
} else {
|
||||
f.bind(this.oReq);
|
||||
f.bind(this);
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
this.oReq.addEventListener(e, function() {
|
||||
f.bind(this.oReq);
|
||||
self.oReq.addEventListener(e, function() {
|
||||
f.bind(this);
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user