Skip to content

Commit

Permalink
[#173] Make error messages more noticeable.
Browse files Browse the repository at this point in the history
Make "error" font red and increase message time on screen.
  • Loading branch information
jaragunde committed Mar 6, 2023
1 parent be96c54 commit 148f3d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
12 changes: 2 additions & 10 deletions web/include/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,9 @@ Ext.extend(Ext.App, Ext.util.Observable, {
* @param {Bool} status
*/
addMessage : function(status, msg) {
var delay = 3; // <-- default delay of msg box is 1 second.
var delay = 3; // <-- default delay
if (status == false) {
delay = 5; // <-- when status is error, msg box delay is 3 seconds.
}
// add some smarts to msg's duration (div by 13.3 between 3 & 9 seconds)
delay = msg.length / 13.3;
if (delay < 3) {
delay = 3;
}
else if (delay > 9) {
delay = 9;
delay = 9; // <-- when status is error, msg box delay is increased
}

this.msgCt.alignTo(document, 't-t');
Expand Down
5 changes: 5 additions & 0 deletions web/include/phpreport.css
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ div#tasks textarea {
margin-bottom: 10px;
}

/* ExtJS message box */
.icon-status-error {
color: #cc0f35;
}

.message.error {
background-color: #feecf0;
border: 1px solid #cc0f35;
Expand Down

0 comments on commit 148f3d7

Please sign in to comment.