Skip to content

Commit

Permalink
Toast messages
Browse files Browse the repository at this point in the history
  • Loading branch information
vaslabs committed Apr 10, 2016
1 parent ade8601 commit dd25255
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions usr/libexec/pi-web-agent/js/system_scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,18 @@ function closeDialog() {
}

function popSuccessMessage(msg) {
var dialog = '<div class="alert alert-dismissable alert-success"><button type="button" class="close" data-dismiss="alert">×</button>' +
'<strong>Success</strong>' + msg + '.</div>'
$("#extension-main-view").prepend(dialog);
if (msg == null || msg == "")
msg = "Success";
else
msg = 'Success: ' + msg;
Materialize.toast(msg, 3000, 'rounded');
}


function popFailMessage(msg) {
var dialog = '<div class="alert alert-dismissable alert-danger"><button type="button" class="close" data-dismiss="alert">×</button>' +
'<strong>Failed: </strong>' + msg + '.</div>'
$("#extension-main-view").prepend(dialog);
if (msg == null || msg == "")
msg = "Unexpected failure!";
else
msg = 'Error: ' + msg;
Materialize.toast(msg, 3000, 'rounded');
}

0 comments on commit dd25255

Please sign in to comment.