From 8936122110ffd3d5d8f7cab5b924d38fa513d17a Mon Sep 17 00:00:00 2001 From: Mathieu Date: Thu, 15 Jan 2015 09:27:16 +0100 Subject: [PATCH] prevent page jump on tooltip actions\n\nExpands the fix of #7367 to tooltip buttons --- IPython/html/static/notebook/js/tooltip.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/IPython/html/static/notebook/js/tooltip.js b/IPython/html/static/notebook/js/tooltip.js index b60cfea60..18888f5e8 100644 --- a/IPython/html/static/notebook/js/tooltip.js +++ b/IPython/html/static/notebook/js/tooltip.js @@ -40,6 +40,7 @@ define([ var expandlink = $('').attr('href', "#").addClass("ui-corner-all") //rounded corner .attr('role', "button").attr('id', 'expanbutton').attr('title', 'Grow the tooltip vertically (press shift-tab twice)').click(function () { that.expand(); + event.preventDefault(); }).append( $('').text('Expand').addClass('ui-icon').addClass('ui-icon-plus')); @@ -49,6 +50,7 @@ define([ morelink.append(morespan); morelink.click(function () { that.showInPager(that._old_cell); + event.preventDefault(); }); // close the tooltip @@ -57,6 +59,7 @@ define([ closelink.append(closespan); closelink.click(function () { that.remove_and_cancel_tooltip(true); + event.preventDefault(); }); this._clocklink = $('').attr('href', "#"); @@ -69,6 +72,7 @@ define([ this._clocklink.append(clockspan); this._clocklink.click(function () { that.cancel_stick(); + event.preventDefault(); });