##// END OF EJS Templates
Merge pull request #2326 from Carreau/detachable-pager...
Bradley M. Froehle -
r8460:19816896 merge
parent child Browse files
Show More
@@ -122,6 +122,10 b' div#pager_splitter {'
122 122 height: 8px;
123 123 }
124 124
125 #pager_container {
126 position : relative;
127 }
128
125 129 div#pager {
126 130 padding: 15px;
127 131 overflow: auto;
@@ -15,6 +15,7 b' var IPython = (function (IPython) {'
15 15
16 16 var Pager = function (pager_selector, pager_splitter_selector) {
17 17 this.pager_element = $(pager_selector);
18 this.pager_button_area = $('#pager_button_area');
18 19 var that = this;
19 20 this.percentage_height = 0.40;
20 21 this.pager_splitter_element = $(pager_splitter_selector)
@@ -39,9 +40,24 b' var IPython = (function (IPython) {'
39 40 });
40 41 this.expanded = false;
41 42 this.style();
43 this.create_button_area();
42 44 this.bind_events();
43 45 };
44 46
47 Pager.prototype.create_button_area = function(){
48 var that = this;
49 this.pager_button_area.append(
50 $('<a>').attr('role', "button")
51 .attr('title',"open the pager in an external window")
52 .addClass('ui-button')
53 .click(function(){that.detach()})
54 .attr('style','position: absolute; right: 10px;')
55 .append(
56 $('<span>').addClass("ui-icon ui-icon-extlink")
57 )
58 )
59 };
60
45 61 Pager.prototype.style = function () {
46 62 this.pager_splitter_element.addClass('border-box-sizing ui-widget ui-state-default');
47 63 this.pager_element.addClass('border-box-sizing ui-widget');
@@ -114,6 +130,26 b' var IPython = (function (IPython) {'
114 130 this.pager_element.empty();
115 131 };
116 132
133 Pager.prototype.detach = function(){
134 var w = window.open("","_blank")
135 $(w.document.head)
136 .append(
137 $('<link>')
138 .attr('rel',"stylesheet")
139 .attr('href',"/static/css/notebook.css")
140 .attr('type',"text/css")
141 )
142 .append(
143 $('<title>').text("IPython Pager")
144 );
145 var pager_body = $(w.document.body)
146 pager_body.attr('style','overflow:scroll');
147
148 pager_body.append(this.pager_element.children())
149 w.document.close();
150 this.collapse();
151
152 }
117 153
118 154 Pager.prototype.append_text = function (text) {
119 155 var toinsert = $("<div/>").addClass("output_area output_stream");
@@ -200,7 +200,11 b' data-notebook-id={{notebook_id}}'
200 200 <div id="notebook_panel">
201 201 <div id="notebook"></div>
202 202 <div id="pager_splitter"></div>
203 <div id="pager"></div>
203 <div id="pager_container">
204 <div id='pager_button_area'>
205 </div>
206 <div id="pager"></div>
207 </div>
204 208 </div>
205 209
206 210 </div>
General Comments 0
You need to be logged in to leave comments. Login now