Skip to content

Commit

Permalink
Merge pull request #1013 from /issues/1010/1
Browse files Browse the repository at this point in the history
Fixes #1010. Make flash messages use fixed positioning.
  • Loading branch information
magsout committed Apr 22, 2016
2 parents 6269b77 + d5ac94e commit 78a256e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

.wc-FlashMessage {
font-size: var(--FlashMessage-fontSize);
position: absolute;
position: fixed;
display:none;
padding: 1.25em 0.5em;
top: 0;
Expand Down
2 changes: 1 addition & 1 deletion webcompat/static/js/lib/bugform.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function BugForm() {
}, this),
error: function() {
var msg = 'There was an error trying to file the bug, try again?.';
wcEvents.trigger('flash:error', {message: msg, timeout: 3000});
wcEvents.trigger('flash:error', {message: msg, timeout: 4000});
}
});
};
Expand Down
2 changes: 1 addition & 1 deletion webcompat/static/js/lib/flash-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var FlashMessageView = Backbone.View.extend({
return this;
},
show: function(opts) {
var timeout = opts.timeout || 3000;
var timeout = opts.timeout || 4000;
var message = opts.message;

this.render(message);
Expand Down
6 changes: 3 additions & 3 deletions webcompat/static/js/lib/issues.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ issues.ImageUploadView = Backbone.View.extend({
}, this),
error: function() {
var msg = 'There was an error trying to upload the image.';
wcEvents.trigger('flash:error', {message: msg, timeout: 3000});
wcEvents.trigger('flash:error', {message: msg, timeout: 4000});
}
});
}
Expand Down Expand Up @@ -418,7 +418,7 @@ issues.MainView = Backbone.View.extend({
}
}, this)).error(function() {
var msg = 'There was an error retrieving issue comments. Please reload to try again.';
wcEvents.trigger('flash:error', {message: msg, timeout: 2000});
wcEvents.trigger('flash:error', {message: msg, timeout: 4000});
});
}
}, this)).error(function(response) {
Expand All @@ -428,7 +428,7 @@ issues.MainView = Backbone.View.extend({
return;
} else {
msg = 'There was an error retrieving the issue. Please reload to try again.';
wcEvents.trigger('flash:error', {message: msg, timeout: 2000});
wcEvents.trigger('flash:error', {message: msg, timeout: 4000});
}
});
},
Expand Down
4 changes: 2 additions & 2 deletions webcompat/static/js/lib/models/issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ issues.Issue = Backbone.Model.extend({
}, this),
error: function() {
var msg = 'There was an error editing this issues\'s status.';
wcEvents.trigger('flash:error', {message: msg, timeout: 2000});
wcEvents.trigger('flash:error', {message: msg, timeout: 4000});
}
});
},
Expand All @@ -116,7 +116,7 @@ issues.Issue = Backbone.Model.extend({
}, this),
error: function() {
var msg = 'There was an error setting labels.';
wcEvents.trigger('flash:error', {message: msg, timeout: 2000});
wcEvents.trigger('flash:error', {message: msg, timeout: 4000});
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions webcompat/static/js/lib/user-activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ issueList.MyIssuesView = Backbone.View.extend(
timeout = e.responseJSON.timeout * 1000;
} else {
message = 'Something went wrong!';
timeout = 3000;
timeout = 4000;
}

this._loadingIndicator.removeClass('is-active');
Expand Down Expand Up @@ -117,7 +117,7 @@ issueList.IssueMentionsView = Backbone.View.extend(
timeout = e.responseJSON.timeout * 1000;
} else {
message = 'Something went wrong!';
timeout = 3000;
timeout = 4000;
}

this._loadingIndicator.removeClass('is-active');
Expand Down
2 changes: 1 addition & 1 deletion webcompat/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<script src="{{ url_for('static', filename='js/lib/bugform.js') }}"></script>
{%- endif %}
{% for category, message in get_flashed_messages(with_categories=True) %}
<script>wcEvents.trigger('flash:{{ category }}', {message: "{{ message }}", timeout: 1500});</script>
<script>wcEvents.trigger('flash:{{ category }}', {message: "{{ message }}", timeout: 4000});</script>
{% endfor %}
{% block extrascripts %}{% endblock %}
</body>
Expand Down

0 comments on commit 78a256e

Please sign in to comment.