##// END OF EJS Templates
Adding Wijmo 2.0b2.
Adding Wijmo 2.0b2.

File last commit:

r5479:0168dc21
r5852:985edaa4
Show More
leftpanel.js
105 lines | 3.4 KiB | application/javascript | JavascriptLexer
Brian E. Granger
More review changes....
r4609 //----------------------------------------------------------------------------
// Copyright (C) 2008-2011 The IPython Development Team
//
// Distributed under the terms of the BSD License. The full license is in
// the file COPYING, distributed as part of this software.
//----------------------------------------------------------------------------
Brian E. Granger
Left panel is now working.
r4363
//============================================================================
// LeftPanel
//============================================================================
var IPython = (function (IPython) {
var utils = IPython.utils;
var LeftPanel = function (left_panel_selector, left_panel_splitter_selector) {
this.left_panel_element = $(left_panel_selector);
this.left_panel_splitter_element = $(left_panel_splitter_selector);
this.expanded = true;
Brian Granger
Refactoring of text/markdown/rst/html cells.
r4508 this.width = 300;
Brian E. Granger
Left panel is now working.
r4363 this.style();
this.bind_events();
Brian E. Granger
Initial draft of panel section and the cell section working.
r4365 this.create_children();
Brian E. Granger
Left panel is now working.
r4363 };
LeftPanel.prototype.style = function () {
this.left_panel_splitter_element.addClass('border-box-sizing ui-widget ui-state-default');
this.left_panel_element.addClass('border-box-sizing ui-widget');
this.left_panel_element.width(this.width);
this.left_panel_splitter_element.css({left : this.width});
MinRK
Add tooltips to the notebook via 'title' attr....
r5097 this.left_panel_splitter_element.attr('title', 'Click to Show/Hide left panel');
Brian E. Granger
Left panel is now working.
r4363 };
LeftPanel.prototype.bind_events = function () {
var that = this;
this.left_panel_element.bind('collapse_left_panel', function () {
that.left_panel_element.hide('fast');
that.left_panel_splitter_element.animate({left : 0}, 'fast');
});
this.left_panel_element.bind('expand_left_panel', function () {
that.left_panel_element.show('fast');
that.left_panel_splitter_element.animate({left : that.width}, 'fast');
});
this.left_panel_splitter_element.hover(
function () {
that.left_panel_splitter_element.addClass('ui-state-hover');
},
function () {
that.left_panel_splitter_element.removeClass('ui-state-hover');
}
);
this.left_panel_splitter_element.click(function () {
that.toggle();
});
};
Brian E. Granger
Initial draft of panel section and the cell section working.
r4365 LeftPanel.prototype.create_children = function () {
Brian E. Granger
Work on save widget, kernel status widget and notebook section.
r4372 this.notebook_section = new IPython.NotebookSection('div#notebook_section');
MinRK
move read_only flag to page-level...
r5213 if (! IPython.read_only){
this.cell_section = new IPython.CellSection('div#cell_section');
Matthias BUSSONNIER
Improve tooltip tringgering,make it configurable...
r5399 this.config_section = new IPython.ConfigSection('div#config_section');
MinRK
move read_only flag to page-level...
r5213 this.kernel_section = new IPython.KernelSection('div#kernel_section');
}
Brian E. Granger
Work on save widget, kernel status widget and notebook section.
r4372 this.help_section = new IPython.HelpSection('div#help_section');
Stefan van der Walt
Clean up javascript based on js2-mode feedback.
r5479 };
Brian E. Granger
Initial draft of panel section and the cell section working.
r4365
Brian E. Granger
Left panel is now working.
r4363 LeftPanel.prototype.collapse = function () {
if (this.expanded === true) {
this.left_panel_element.add($('div#notebook')).trigger('collapse_left_panel');
this.expanded = false;
};
};
LeftPanel.prototype.expand = function () {
if (this.expanded !== true) {
this.left_panel_element.add($('div#notebook')).trigger('expand_left_panel');
this.expanded = true;
};
};
LeftPanel.prototype.toggle = function () {
if (this.expanded === true) {
this.collapse();
} else {
this.expand();
};
};
IPython.LeftPanel = LeftPanel;
return IPython;
}(IPython));