Permalink
Browse files

Merge PR #1132

Improve read-only style

closes #1132
  • Loading branch information...
2 parents 7384bb9 + 3c008c0 commit 8e021bb698d008bbb55c527b5bcbe803ad50b60e @minrk minrk committed Dec 12, 2011
@@ -27,6 +27,9 @@ var IPython = (function (IPython) {
NotebookList.prototype.bind_events = function () {
+ if (IPython.read_only){
+ return;
+ }
var that = this;
this.element.bind('dragover', function () {
return false;
@@ -106,6 +106,10 @@ $(document).ready(function () {
$('div#config_section').addClass('hidden');
$('div#kernel_section').addClass('hidden');
$('span#login_widget').removeClass('hidden');
+
+ // set the notebook name field as not modifiable
+ $('#notebook_name').attr('disabled','disabled')
+
// left panel starts collapsed, but the collapse must happen after
// elements start drawing. Don't draw contents of the panel until
// after they are collapsed
@@ -33,9 +33,12 @@ $(document).ready(function () {
IPython.login_widget = new IPython.LoginWidget('span#login_widget');
if (IPython.read_only){
- $('#new_notebook').addClass('hidden');
// unhide login button if it's relevant
$('span#login_widget').removeClass('hidden');
+ $('#drag_info').remove();
+ } else {
+ $('#new_notebook').removeClass('hidden');
+ $('#drag_info').removeClass('hidden');
}
IPython.notebook_list.load_list();
@@ -20,9 +20,9 @@
{% block content_panel %}
<div id="content_toolbar">
- <span id="drag_info">Drag files onto the list to import notebooks.</span>
+ <span id="drag_info" class="hidden">Drag files onto the list to import notebooks.</span>
<span id="notebooks_buttons">
- <button id="new_notebook">New Notebook</button>
+ <button id="new_notebook" class="hidden">New Notebook</button>
</span>
</div>
<div id="notebook_list">

0 comments on commit 8e021bb

Please sign in to comment.