##// END OF EJS Templates
Reverse hscrollbar min-height hack on OS X...
Reverse hscrollbar min-height hack on OS X OS X has optional behavior to only draw scrollbars during scroll, which causes problems for CodeMirror's scrollbars. CodeMirror's solution is to set a minimum size for their scrollbars, which is always present. The trade is that the container overlays most of the last line, swallowing click events when there is scrolling to do, even when no scrollbar is visible. This reverses the trade, recovering the click events at the expense of never showing the horizontal scrollbar on OS X when this option is enabled.

File last commit:

r20003:0bd8eacb
r20298:2907e856
Show More
sessionlist.js
85 lines | 2.8 KiB | application/javascript | JavascriptLexer
Jonathan Frederic
Finished making tree.html requirejs friendly
r17190 // Copyright (c) IPython Development Team.
// Distributed under the terms of the Modified BSD License.
Paul Ivanov
added IPython.session_list...
r15479
Jonathan Frederic
Finished making tree.html requirejs friendly
r17190 define([
'base/js/namespace',
Jonathan Frederic
MWE,...
r17200 'jquery',
Jonathan Frederic
Finished making tree.html requirejs friendly
r17190 'base/js/utils',
Jonathan Frederic
Almost done!...
r17198 ], function(IPython, $, utils) {
Paul Ivanov
added IPython.session_list...
r15479 "use strict";
jon
Added some nice comments,...
r17211 var SesssionList = function (options) {
Jonathan Frederic
Ran function comment conversion tool
r19176 /**
* Constructor
*
* Parameters:
* options: dictionary
* Dictionary of keyword arguments.
* events: $(Events) instance
* base_url : string
*/
jon
In person review with @ellisonbg
r17210 this.events = options.events;
Paul Ivanov
added IPython.session_list...
r15479 this.sessions = {};
Jonathan Frederic
Almost done!...
r17198 this.base_url = options.base_url || utils.get_body_data("baseUrl");
Jonathan Frederic
Animated arrow icon
r20003
// Add collapse arrows.
$('#running .panel-group .panel .panel-heading a').each(function(index, el) {
var $link = $(el);
var $icon = $('<i />')
.addClass('fa fa-caret-down');
$link.append($icon);
$link.down = true;
$link.click(function () {
if ($link.down) {
$link.down = false;
// jQeury doesn't know how to animate rotations. Abuse
// jQueries animate function by using an unused css attribute
// to do the animation (borderSpacing).
$icon.animate({ borderSpacing: 90 }, {
step: function(now,fx) {
$icon.css('transform','rotate(-' + now + 'deg)');
}
}, 250);
} else {
$link.down = true;
// See comment above.
$icon.animate({ borderSpacing: 0 }, {
step: function(now,fx) {
$icon.css('transform','rotate(-' + now + 'deg)');
}
}, 250);
}
});
});
Paul Ivanov
added IPython.session_list...
r15479 };
SesssionList.prototype.load_sessions = function(){
var that = this;
var settings = {
processData : false,
cache : false,
type : "GET",
dataType : "json",
MinRK
log all failed ajax API requests
r16445 success : $.proxy(that.sessions_loaded, this),
Jonathan Frederic
Almost done!...
r17198 error : utils.log_ajax_error,
Paul Ivanov
added IPython.session_list...
r15479 };
Jonathan Frederic
Almost done!...
r17198 var url = utils.url_join_encode(this.base_url, 'api/sessions');
Paul Ivanov
small whitespace cleanup, renamed drag_info...
r15518 $.ajax(url, settings);
Paul Ivanov
added IPython.session_list...
r15479 };
SesssionList.prototype.sessions_loaded = function(data){
this.sessions = {};
var len = data.length;
Paul Ivanov
remove redundant checks in code
r15513 var nb_path;
for (var i=0; i<len; i++) {
Min RK
update add_duplicate_button with API changes...
r18928 nb_path = data[i].notebook.path;
Paul Ivanov
remove redundant checks in code
r15513 this.sessions[nb_path] = data[i].id;
Paul Ivanov
added IPython.session_list...
r15479 }
Jonathan Frederic
Fixed events
r17195 this.events.trigger('sessions_loaded.Dashboard', this.sessions);
Paul Ivanov
added IPython.session_list...
r15479 };
Jonathan Frederic
Finished making tree.html requirejs friendly
r17190 // Backwards compatability.
IPython.SesssionList = SesssionList;
Paul Ivanov
added IPython.session_list...
r15479
Jonathan Frederic
Return dicts instead of classes,...
r17201 return {'SesssionList': SesssionList};
Jonathan Frederic
Finished making tree.html requirejs friendly
r17190 });