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, add an icon next to it and increase message
time on screen.
  • Loading branch information
jaragunde committed Mar 7, 2023
1 parent cadc4af commit 6b5ff76
Show file tree
Hide file tree
Showing 2 changed files with 17 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
15 changes: 15 additions & 0 deletions web/include/phpreport.css
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,21 @@ div#tasks textarea {
margin-bottom: 10px;
}

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

.icon-status-error:before {
content: "";
position: absolute;
height: 16px;
width: 16px;
left: 14px;
background-image: url(icons/cross.png);
}

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

0 comments on commit 6b5ff76

Please sign in to comment.