add text placeholder for kernels with no logo

capital first initial on gray field
This commit is contained in:
Min RK 2014-12-09 15:51:48 -08:00
parent d5f6aaa1f6
commit da88bff678
4 changed files with 25 additions and 5 deletions

View File

@ -126,7 +126,8 @@ define([
this.events.on('spec_changed.Kernel', function(event, data) {
that.current_selection = data.name;
$("#kernel_indicator").find('.kernel_indicator_name').text(data.display_name);
that.element.find("#current_kernel_logo").attr("src", that.notebook.base_url+"kernelspecs/"+data.name+"/logo-64x64.png");
that.element.find("img.current_kernel_logo").attr("src", that.notebook.base_url + "kernelspecs/" + data.name + "/logo-64x64.png");
that.element.find("div.current_kernel_logo").text(data.display_name.slice(0,1).toUpperCase());
});
this.events.on('kernel_created.Session', function(event, data) {
@ -139,12 +140,15 @@ define([
}
});
var logo_img = this.element.find("#current_kernel_logo");
var logo_img = this.element.find("img.current_kernel_logo");
var logo_div = this.element.find("div.current_kernel_logo");
logo_img.on("load", function() {
logo_div.hide();
logo_img.show();
});
logo_img.on("error", function() {
logo_img.hide();
logo_div.show();
});
};

View File

@ -2,9 +2,17 @@
margin-right: 1em;
.pull-right();
& > img#current_kernel_logo {
.current_kernel_logo {
display: none;
.navbar-vertical-align(32px);
width: 32px;
height: 32px;
}
div.current_kernel_logo {
background-color: darken(@navbar-default-bg, 10%);
font-size: 24px;
text-align: center;
text-decoration: bold;
}
}

View File

@ -9677,12 +9677,19 @@ select[multiple].celltoolbar select {
float: right !important;
float: right;
}
#kernel_logo_widget > img#current_kernel_logo {
#kernel_logo_widget .current_kernel_logo {
display: none;
margin-top: -1px;
margin-bottom: -1px;
width: 32px;
height: 32px;
}
#kernel_logo_widget div.current_kernel_logo {
background-color: #dfdfdf;
font-size: 24px;
text-align: center;
text-decoration: bold;
}
#menubar {
box-sizing: border-box;
-moz-box-sizing: border-box;

View File

@ -43,7 +43,8 @@ class="notebook_app"
</span>
<span id="kernel_logo_widget">
<img id="current_kernel_logo"/>
<img class="current_kernel_logo"/>
<div class="current_kernel_logo"></div>
</span>
{% endblock headercontainer %}