From ac164431292101115ce028e488e022585e4df284 Mon Sep 17 00:00:00 2001 From: Stefan Liebenberg Date: Thu, 13 Apr 2017 09:53:27 +0200 Subject: [PATCH] adding default prevention --- iron-ajax.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/iron-ajax.html b/iron-ajax.html index fa2fcc6..9733799 100644 --- a/iron-ajax.html +++ b/iron-ajax.html @@ -498,15 +498,17 @@ } // Tests fail if this goes after the normal this.fire('error', ...) - this.fire('iron-ajax-error', { + var errorEvent = this.fire('iron-ajax-error', { request: request, error: error }, {bubbles: this.bubbles}); - this.fire('error', { - request: request, - error: error - }, {bubbles: this.bubbles}); + if(!errorEvent.defaultPrevented) { + this.fire('error', { + request: request, + error: error + }, {bubbles: this.bubbles}); + } }, _discardRequest: function(request) {