Skip to content

Commit

Permalink
fix resize not work on iframe (web panel)
Browse files Browse the repository at this point in the history
  • Loading branch information
binux committed Nov 5, 2014
1 parent 3f5f205 commit df65986
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
9 changes: 8 additions & 1 deletion webui/static/debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ window.Debugger = (function() {
return {
init: function() {
//init resizer
$(".debug-panel:not(:first)").splitter().data('splitter').trigger('init');
$(".debug-panel:not(:first)").splitter().data('splitter')
.trigger('init')
.on('resize-start', function() {
$('#left-area .overlay').show();
})
.on('resize-end', function() {
$('#left-area .overlay').hide();
});

//codemirror
CodeMirror.keyMap.basic.Tab = 'indentMore';
Expand Down
3 changes: 2 additions & 1 deletion webui/static/splitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ $.fn.splitter = function (_type) {

var splitterSettings = JSON.parse(localStorage.getItem('splitterSettings') || '[]');
return this.each(function () {
console.log(_type);
var $el = $(this),
$originalContainer = $(this),
guid = $.fn.splitter.guid++,
Expand Down Expand Up @@ -154,6 +153,7 @@ $.fn.splitter = function (_type) {
$document.bind('mouseup touchend', function () {
if (dragging) {
dragging = false;
$handle.trigger('resize-end');
$blocker.remove();
// $handle.css( 'opacity', '0');
$body.removeClass('dragging');
Expand All @@ -172,6 +172,7 @@ $.fn.splitter = function (_type) {

$handle.bind('mousedown touchstart', function (e) {
dragging = true;
$handle.trigger('resize-start');
$body.append($blocker).addClass('dragging');
props[type].size = $parent[props[type].sizeProp]();
props[type].currentPos = 0; // is this really required then?
Expand Down
2 changes: 1 addition & 1 deletion webui/templates/debug.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<div class="overlay" style="display: none;"></div>
</div>

<div class="debug-panel" style="left: 50%">
<div id="right-area" class="debug-panel" style="left: 50%">
<div id="python-editor" class="editor focus">
<div id="save-task-btn">save</div>
</div>
Expand Down

0 comments on commit df65986

Please sign in to comment.