Skip to content

Commit

Permalink
IDE: popup can now take an 'error' parameter which sets the overlay c…
Browse files Browse the repository at this point in the history
…olor
  • Loading branch information
giuliomoro committed Jun 17, 2022
1 parent d7baa45 commit e6c2477
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions IDE/frontend-dev/scss/_popup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -165,5 +165,8 @@
&.active-popup{
@include active();
background: rgba(0, 0, 0, 0.3);
&.no {
background: rgba(255, 0, 0, 0.3);
}
}
}
6 changes: 6 additions & 0 deletions IDE/frontend-dev/src/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function callFunc(func, arg)
}

const overlayActiveClass = 'active-popup';
const errorClass = 'no';
var popup = {
defaultStrings: {
cancel: json.popups.generic.cancel,
Expand All @@ -28,6 +29,7 @@ var popup = {
'input[type=text]',
],
titleClass: '',
error: false,
},
isShown(){
return parent.hasClass('active');
Expand Down Expand Up @@ -120,6 +122,10 @@ var popup = {
}
}
titleEl.addClass(opts.titleClass);
if(opts.error)
overlay.addClass(errorClass);
else
overlay.removeClass(errorClass);
},

respondToEvent(callback, e) {
Expand Down
2 changes: 2 additions & 0 deletions IDE/public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,8 @@ ul dl {
width: 100vw;
z-index: 9998;
background: rgba(0, 0, 0, 0.3); }
#overlay.active-popup.no {
background: rgba(255, 0, 0, 0.3); }

::-webkit-scrollbar {
width: 12px; }
Expand Down
5 changes: 4 additions & 1 deletion IDE/public/js/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e6c2477

Please sign in to comment.