Skip to content

Commit

Permalink
Disable draggable #150
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo Peng committed Dec 5, 2018
1 parent 968c236 commit 2da19fe
Showing 1 changed file with 1 addition and 57 deletions.
58 changes: 1 addition & 57 deletions src/sos_notebook/kernel.js
Original file line number Diff line number Diff line change
Expand Up @@ -1247,48 +1247,7 @@ define([
});

// enable dragging and save position on stop moving
$("#panel-wrapper").draggable({

drag: function(event, ui) {

// If dragging to the left side, then transforms in sidebar
if ((ui.position.left <= 0) && (nb.metadata["sos"]["panel"].style === "float")) {
nb.metadata["sos"]["panel"].style = "side";
nb.metadata["sos"]["panel"].height = $("#panel-wrapper").css("height");
panel_wrapper.removeClass("float-wrapper").addClass("sidebar-wrapper");
$("#notebook-container").css("margin-left", $("#panel-wrapper").width() + 30);
$("#notebook-container").css("width", $("#notebook").width() - $("#panel-wrapper").width() - 30);
ui.position.top = $("#header").height();
ui.position.left = 0;
$("#panel-wrapper").css("height", $("#site").height());
}
if (ui.position.left <= 0) {
ui.position.left = 0;
ui.position.top = $("#header").height();
}
if ((ui.position.left > 0) && (nb.metadata["sos"]["panel"].style === "side")) {
nb.metadata["sos"]["panel"].style = "float";
if (nb.metadata["sos"]["panel"].height === 0) {
nb.metadata["sos"]["panel"].height = Math.max($("#site").height() / 2, 200);
}
$("#panel-wrapper").css("height", nb.metadata["sos"]["panel"].height);
panel_wrapper.removeClass("sidebar-wrapper").addClass("float-wrapper");
$("#notebook-container").css("margin-left", 30);
$("#notebook-container").css("width", $("#notebook").width() - 30);
}

}, //end of drag function
start: function(event, ui) {
$(this).width($(this).width());
},
stop: function(event, ui) {
// Ensure position is fixed (again)
$("#panel-wrapper").css("position", "fixed");
},
// can only drag from the border, not the panel and the cell. This
// allows us to, for example, copy/paste output area.
cancel: "#panel, #input"
});
$("#panel-wrapper").draggable({ disabled: true });

$("#panel-wrapper").resizable({
resize: function(event, ui) {
Expand Down Expand Up @@ -1707,21 +1666,6 @@ define([
margin-bottom: 10px;
}
.float-wrapper {
position: fixed !important;
top: 120px;
/* max-width:600px; */
right: 20px;
border: thin solid rgba(0, 0, 0, 0.38);
border-radius: 5px;
/* padding:5px;
padding-top:10px;
background-color: #F8F5E1; */
opacity: .8;
z-index: 100;
overflow: hidden;
}
.sidebar-wrapper {
height: 100%;
left: 5px;
Expand Down

0 comments on commit 2da19fe

Please sign in to comment.