Skip to content

Commit

Permalink
added(sass): option to set overdue flash color in _settings.sass
Browse files Browse the repository at this point in the history
cleanup(code)
  • Loading branch information
polonel committed Sep 19, 2018
1 parent eeaf905 commit ffc2938
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 27 deletions.
20 changes: 10 additions & 10 deletions src/models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,19 @@ userSchema.pre('save', function(next) {

user.username = user.username.trim();

if (user.isModified('password')) {
bcrypt.genSalt(SALT_FACTOR, function (err, salt) {
if (err) return next(err);
if (!user.isModified('password'))
return next();

bcrypt.hash(user.password, salt, function (err, hash) {
if (err) return next(err);
bcrypt.genSalt(SALT_FACTOR, function (err, salt) {
if (err) return next(err);

user.password = hash;
return next();
});
bcrypt.hash(user.password, salt, function (err, hash) {
if (err) return next(err);

user.password = hash;
return next();
});
} else
return next();
});
});

userSchema.methods.addAccessToken = function(callback) {
Expand Down
23 changes: 7 additions & 16 deletions src/public/js/pages/tickets.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,13 @@ define('pages/tickets', [
return isNaN(x) ? '00' : hexDigits[(x - x % 16) / 16] + hexDigits[x % 16];
}

$('tr.overdue').each(function() {
var self = $(this);
self.css('background-color', '#b71c1c');
self.find('td').css('color', '#fff');
setInterval(function() {
var bgColor = self.css('background-color');
bgColor = rgb2hex(bgColor);
if (bgColor === '#b71c1c') {
self.css('background-color', '#ffffff');
self.find('td').css('color', '#55616e');
} else {
self.css('background-color', '#b71c1c');
self.find('td').css('color', '#fff');
}
}, 800);
});
setInterval(function() {
var $overDueTR = $('tr.overdue');
if ($overDueTR.hasClass('overdue-red'))
$overDueTR.removeClass('overdue-red');
else
$overDueTR.addClass('overdue-red');
}, 800);

if (typeof callback === 'function')
return callback();
Expand Down
3 changes: 2 additions & 1 deletion src/sass/_settings.sass
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ $p_color: $text_color


//THEME
$logo_text_color: #FFFFFF
$logo_circle_color: #E74C3C

Expand Down Expand Up @@ -50,6 +49,8 @@ $page_content_border_accent: 2px solid $page_content_title_bg
$page_content_button_color: #FFFFFF
$page_content_button_text_color: $sidebar_item_active

$overdue_flash_color: #b71c1c

$ticket_status_new: $accent_success
$ticket_status_open: $accent_danger
$ticket_status_pending: $accent_blue
Expand Down
5 changes: 5 additions & 0 deletions src/sass/partials/tickets.sass
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
@media only screen and (min-width: 40.063em) and (max-width: 64em)
padding: 0 0 0 55px !important

.overdue-red
background: $overdue_flash_color !important
td
color: white !important

.ticketList,
.accountList
overflow: hidden
Expand Down

0 comments on commit ffc2938

Please sign in to comment.