implemented support of dark and light theme

This commit is contained in:
Borys Levytskyi
2015-04-05 17:46:12 +03:00
parent 7f5134dd59
commit 1fca0dace6
8 changed files with 38 additions and 7 deletions

View File

@@ -13,6 +13,7 @@
app.bootstrap = function(rootViewElement) {
this.rootViewElement = rootViewElement;
this.set('rootView', rootViewElement)
this.initialize();
};

View File

@@ -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();
}
});

View File

@@ -93,7 +93,6 @@ app.compose(function() {
}
}
});
});

View File

@@ -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) {