diff options
author | Christoph (Sheogorath) Kern | 2018-01-16 14:38:14 +0700 |
---|---|---|
committer | GitHub | 2018-01-16 14:38:14 +0700 |
commit | 72011446613e9d22097879d3ec825416e46ca910 (patch) | |
tree | 0824f15f9db94cb80d39c2c7a0295205b94d160b /public/js/index.js | |
parent | a8fa88831705625e053c7d493a4b2f83b7b2a4a8 (diff) | |
parent | 6fc2c39eda766cffc7ef5c9e1d3d3cbce8ab7590 (diff) |
Merge pull request #661 from edoardoo/darkTheme
Implemented dark theme.
Diffstat (limited to 'public/js/index.js')
-rw-r--r-- | public/js/index.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/public/js/index.js b/public/js/index.js index b336af90..5ff716fd 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -1633,6 +1633,10 @@ ui.toolbar.view.click(function () { ui.toolbar.both.click(function () { changeMode(modeType.both) }) + +ui.toolbar.night.click(function () { + toggleNightMode() +}) // permission // freely ui.infobar.permission.freely.click(function () { @@ -1666,6 +1670,17 @@ $('.ui-delete-modal-confirm').click(function () { socket.emit('delete') }) +function toggleNightMode () { + var $body = $('body') + var isActive = ui.toolbar.night.hasClass('active') + if (isActive) { + $body.removeClass('night') + appState.nightMode = false + } else { + $body.addClass('night') + appState.nightMode = true + } +} function emitPermission (_permission) { if (_permission !== permission) { socket.emit('permission', _permission) |