Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open notebook copy in different tabs #2128

Merged
merged 1 commit into from Jul 12, 2012
Merged

Conversation

Carreau
Copy link
Member

@Carreau Carreau commented Jul 12, 2012

use time since epoch to avoid reusing the same tab
fixes #2120
as long as one dos not open more that one tab per second.

@ellisonbg
Copy link
Member

This looks great.

@minrk
Copy link
Member

minrk commented Jul 12, 2012

I think this is the wrong approach. The target should just be _blank, which is always a new tab/window. No sensitivity to time or anything.

@ellisonbg
Copy link
Member

So what is causing it to open in the same tab then?

On Thu, Jul 12, 2012 at 8:56 AM, Min RK
reply@reply.github.com
wrote:

I think this is the wrong approach. The target should just be _blank, which is always a new tab/window. No sensitivity to time or anything.


Reply to this email directly or view it on GitHub:
#2128 (comment)

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

@ellisonbg
Copy link
Member

I could swear that it used to work perfectly.

On Thu, Jul 12, 2012 at 9:00 AM, Brian Granger ellisonbg@gmail.com wrote:

So what is causing it to open in the same tab then?

On Thu, Jul 12, 2012 at 8:56 AM, Min RK
reply@reply.github.com
wrote:

I think this is the wrong approach. The target should just be _blank, which is always a new tab/window. No sensitivity to time or anything.


Reply to this email directly or view it on GitHub:
#2128 (comment)

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

@Carreau
Copy link
Member Author

Carreau commented Jul 12, 2012

it does the same with _blank if any of the main page or its fork call window.open(url,'_blank') it will load in the forked tabs.

@Carreau
Copy link
Member Author

Carreau commented Jul 12, 2012

Note that it works the first time correctly but not afterward, as if _newtab was an identifier of the newly open tab.
You can try from js console in any website, it does the same. That not from our side.

@Carreau
Copy link
Member Author

Carreau commented Jul 12, 2012

Also I used time to be sure to have 2 different number, I can write a randint function but that's more line of code and overkill.

@minrk
Copy link
Member

minrk commented Jul 12, 2012

@Carreau - that is not true of _blank. _blank is a special identifier, and you can click on the same link a hundred times and it will open a hundred new tabs.

For example:

target=_new_tab

target=_blank

@Carreau
Copy link
Member Author

Carreau commented Jul 12, 2012

@minrk
That was my first thought; but I tried and it wasn't working... I might have mistyped, i'll try again.

returning false to allow modifier+click,
otherwise open 2 tabs at once.
@Carreau
Copy link
Member Author

Carreau commented Jul 12, 2012

So my bad, I should have misstype, but I can swear that this was the first thing I tryed.
updated and force pushed.
A ended with a return false otherwise ctrl-click open both the copy and the curent notebook in 2 new tabs.
It has the side effect of opening in a new tab instead of a new window also.
I let you merge.

@minrk
Copy link
Member

minrk commented Jul 12, 2012

No worries.

This looks good to me now. Thanks!

@Carreau
Copy link
Member Author

Carreau commented Jul 12, 2012

cool, merging !

Carreau added a commit that referenced this pull request Jul 12, 2012
open notebook copy in different tabs
@Carreau Carreau merged commit 6ce7c7a into ipython:master Jul 12, 2012
Carreau added a commit to Carreau/ipython that referenced this pull request Jul 13, 2012
returning false to allow modifier+click,
otherwise open 2 tabs at once.

fixes ipython#2120

backported to 0.13.1 from PR ipython#2128
minrk added a commit that referenced this pull request Jul 21, 2012
use time since epoch to avoid reusing the same tab
fixes #2120
as long as one dos not open more that one tab per second.
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
open notebook copy in different tabs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Notebook "Make a Copy..." keeps opening duplicates in the same tab
3 participants