Commit 9f0866c8 by pratik24mac Committed by Madhan Neethiraj

ATLAS-2350: UI - after error notification during search, there is an icon buffering forever

parent c6cc3314
...@@ -184,19 +184,14 @@ define(['require', ...@@ -184,19 +184,14 @@ define(['require',
} }
}); });
this.listenTo(this.searchCollection, "error", function(model, response) { this.listenTo(this.searchCollection, "error", function(model, response) {
this.$('.fontLoader').hide(); this.hideLoader({ type: 'error' });
this.$('.tableOverlay').hide(); var responseJSON = response && response.responseJSON ? response.responseJSON : null,
var responseJSON = response && response.responseJSON ? response.responseJSON : null; errorText = (responseJSON && (responseJSON.errorMessage || responseJSON.message || responseJSON.error ))|| 'Invalid Expression';
if (responseJSON && (responseJSON.errorMessage || responseJSON.message || responseJSON.error)) { if (errorText) {
Utils.notifyError({ Utils.notifyError({
content: responseJSON.errorMessage || responseJSON.message || responseJSON.error content: errorText
}); });
} else { this.$('.searchTable > .well').html('<center>' + errorText + '</center>')
if (response.statusText !== "abort") {
Utils.notifyError({
content: "Invalid Expression"
});
}
} }
}, this); }, this);
this.listenTo(this.searchCollection, "state-changed", function(state) { this.listenTo(this.searchCollection, "state-changed", function(state) {
...@@ -847,9 +842,9 @@ define(['require', ...@@ -847,9 +842,9 @@ define(['require',
this.$('.fontLoader:not(.for-ignore)').addClass('show'); this.$('.fontLoader:not(.for-ignore)').addClass('show');
this.$('.tableOverlay').addClass('show'); this.$('.tableOverlay').addClass('show');
}, },
hideLoader: function() { hideLoader: function(options) {
this.$('.fontLoader:not(.for-ignore)').removeClass('show'); this.$('.fontLoader:not(.for-ignore)').removeClass('show');
this.$('.ellipsis,.pagination-box').show(); // only for first time options && options.type === 'error' ? this.$('.ellipsis,.pagination-box').hide() : this.$('.ellipsis,.pagination-box').show(); // only show for first time and hide when type is error
this.$('.tableOverlay').removeClass('show'); this.$('.tableOverlay').removeClass('show');
}, },
checkedValue: function(e) { checkedValue: function(e) {
......
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