When clicking the Apply button to search for specific videos, it switches to the Upload tab when the results are loaded. I have to manually click the YouTube tab to see the results.

This might confuse users until they realize how it works. However, it should really stay on the YouTube tab.

When submitting the form through one of the buttons: Apply, Next or Previous the page is refreshed without adding the correct fragment. In this case '#media-tab-youtube'.

See #5 for steps to reproduce.

XREF : Part of this issue depends on media #1802026-6: Ajax callbacks in the media overlay cause the active tab to switch tab unexpectedly

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gmclelland’s picture

RobW’s picture

Title: When searching it does not retain tab when loading result » YouTube Tab: When searching it does not retain tab when loading result
dddave’s picture

mrfelton’s picture

clemens.tolboom’s picture

The cause for this issue and #1593624: YouTube tab: Next Link doesn't work correctly is that the media browser or more specific jQuery UI tab does not get the fragment #media-youtube

Testing this with
http://example.com/media/browser?render=media-popup#media-tab-youtube
selects the correct tab. Make sure you refresh the page when editing the fragment into ie. media/browser?render=media-popup#media-tab-media_internet

So we need to fix this either through media_youtube or media module to add the fragment. jQuery UI Tabs then uses this.

clemens.tolboom’s picture

Title: YouTube Tab: When searching it does not retain tab when loading result » YouTube Tab: When apply searching, next or previous button it does not retain tab when loading result
aaron’s picture

Status: Active » Needs work
FileSize
706 bytes

This patch will fix the issue with the next/previous links. I still need to address the search button itself.

clemens.tolboom’s picture

Status: Needs work » Active

@aaron nice.

For the Search Button we probably need media to fix for that iframe fragment in line with

(http://stackoverflow.com/questions/4299435/remember-which-tab-was-active...)

 # javascript
$(".tabs").tabs({
    select: function(event, ui) {                   
       window.location.hash = ui.tab.hash;
    },
});

But this is more a solution for the container aka media module

using the setter (and getter?) like (http://api.jqueryui.com/tabs/#option-active)

 #javascript
// getter
var collapsible = $( ".selector" ).tabs( "option", "collapsible" );
// setter
$( ".selector" ).tabs( "option", "collapsible", true );

(hope this helps)

gmclelland’s picture

Thanks @aaron and @clemens.tolboom. The patch in #7 works, but it also makes the page jump to the top of the media browser dialog each time you click on next or previous links. I'm not sure if there is a way around that. It's still an improvement.

clemens.tolboom’s picture

I added my media related comment from #8 to #1802026-5: Ajax callbacks in the media overlay cause the active tab to switch tab unexpectedly.

@gmclelland what do you mean by 'jumps to the top'. Is the dialog not high enough? Please search for a bug report in media or media_youtube or create a new one :-)

gmclelland’s picture

FileSize
518.73 KB
391.32 KB

@clemens.tolboom - See the screenshots for an example of how the dialog jumps.

The first screenshot shows before I click "next"
The second screenshot shows the after. Notice how the media browser is at the top of the page?

Hope that helps illustrate what I'm talking about.

gmclelland’s picture

Issue summary: View changes

Added comment #5 partly

clemens.tolboom’s picture

Status: Active » Needs review

I think I fixed the Apply problem in media: #1802026-6: Ajax callbacks in the media overlay cause the active tab to switch tab unexpectedly

So this is now only about Next & Previous and only needs a review.

@gmclelland please check the issue queue(s) for your bug which is probably media.module related.

clemens.tolboom’s picture

Status: Needs review » Reviewed & tested by the community
torotil’s picture

Status: Reviewed & tested by the community » Needs work

I can still reproduce the tab-switching with the 2.0-alpha1 media release and the patch mentioned in this issue: Searching for youtube-videos jumps to the upload tab …

jlk4p’s picture

I still reproduce this next/previous problem with Media 2.0-alpha2/Youtube 2.0-rc3 releases. The patch applied for Media 7.x-2.0 in comment 31 for #1802026: Ajax callbacks in the media overlay cause the active tab to switch tab unexpectedly does eliminate the tab from changing if the apply button is clicked.

jlk4p’s picture

Issue summary: View changes

Updated issue summary.