mirror of
https://github.com/BorysLevytskyi/BitwiseCmd.git
synced 2026-01-27 22:24:34 +01:00
implemented support of dark and light theme
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
|
||||
app.bootstrap = function(rootViewElement) {
|
||||
this.rootViewElement = rootViewElement;
|
||||
this.set('rootView', rootViewElement)
|
||||
this.initialize();
|
||||
};
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@ app.run(function() {
|
||||
|
||||
var cmd = app.get('cmd');
|
||||
var cmdConfig = app.get('cmdConfig');
|
||||
var rootView = app.get('rootView');
|
||||
var shell = app.get('shell');
|
||||
|
||||
cmd.commands({
|
||||
'help': function() {
|
||||
@@ -18,6 +20,12 @@ app.run(function() {
|
||||
},
|
||||
'em': function() {
|
||||
cmdConfig.emphasizeBytes = !cmdConfig.emphasizeBytes;
|
||||
},
|
||||
'dark': function() {
|
||||
shell.setDarkTheme();
|
||||
},
|
||||
light: function () {
|
||||
shell.setLightTheme();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -93,7 +93,6 @@ app.compose(function() {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -32,6 +32,20 @@
|
||||
}
|
||||
});
|
||||
|
||||
app.set('shell', function(){
|
||||
var rootView = app.get('rootView');
|
||||
|
||||
return {
|
||||
setDarkTheme: function() {
|
||||
rootView.classList.remove('light');
|
||||
rootView.classList.add('dark');
|
||||
},
|
||||
setLightTheme: function() {
|
||||
rootView.classList.remove('dark');
|
||||
rootView.classList.add('light');
|
||||
}
|
||||
}
|
||||
});
|
||||
/*
|
||||
var template = {
|
||||
compile: function (template) {
|
||||
|
||||
Reference in New Issue
Block a user