Hide kernel logo if it's missing

This commit is contained in:
Thomas Kluyver 2014-09-24 12:28:29 -07:00
parent f123b0d2ad
commit cad0c32137
2 changed files with 9 additions and 1 deletions

View File

@ -97,6 +97,14 @@ define([
that.events.trigger('spec_changed.Kernel', ks);
}
});
var logo_img = this.element.find("#current_kernel_logo")
logo_img.on("load", function() {
logo_img.show();
});
logo_img.on("error", function() {
logo_img.hide();
});
};
return {'KernelSelector': KernelSelector};

View File

@ -42,7 +42,7 @@ class="notebook_app"
</span>
<span id="kernel_selector_widget" class="pull-right dropdown">
<img id="current_kernel_logo" src="/kernelspecs/python/logo-32.png"/>
<img id="current_kernel_logo"/>
<button class="dropdown-toggle btn btn-sm navbar-btn" data-toggle="dropdown" type='button' id="current_kernel_spec">
<span class='kernel_name'>Kernel</span>
<span class="caret"></span>