With latest jQuery Update and jQuery UI 1.10.2 media browser doesn't change it's height which is stuck to 280 px due to Drupal.media.browser.resizeIframe which is never called.
The reason of this is API change in jQuery UI 1.10.x: Tabs Widget API has no "show" event anymore according to: http://bugs.jqueryui.com/ticket/7155

Files: 
CommentFileSizeAuthor
#10 media_browser-1957812-10.patch1.03 KBsylus
PASSED: [[SimpleTest]]: [MySQL] 92 pass(es).
[ View ]
#9 media_browser-1957812-09.patch1001 bytessylus
PASSED: [[SimpleTest]]: [MySQL] 92 pass(es).
[ View ]
#8 media_browser_-1957812-08.patch1001 bytessylus
PASSED: [[SimpleTest]]: [MySQL] 92 pass(es).
[ View ]
#1 media_browser-1957812-1.patch1 KBOnkelTem
PASSED: [[SimpleTest]]: [MySQL] 92 pass(es).
[ View ]

Comments

OnkelTem’s picture

Status:Active» Needs review
StatusFileSize
new1 KB
PASSED: [[SimpleTest]]: [MySQL] 92 pass(es).
[ View ]
avr’s picture

Ran into this issue - this looks & works well for me.

Might as well also add:

create: Drupal.media.browser.resizeIframe

so that the dialog is resized on initial load (sorry - didn't have a good setup to reroll the patch). This also helps if you have an error/message in your form submission.

gagarine’s picture

Status:Needs review» Closed (duplicate)
Rob C’s picture

Status:Closed (duplicate)» Needs review

Re-opening, because this issue already has a patch available. (while it is newer)

Rob C’s picture

Status:Needs review» Closed (works as designed)

And https://drupal.org/node/1956634#comment-7532673 looks true. (after some testing)

Update to the latest jquery_update 2.x-dev (or git) and configure jquery 1.8, then you do not need to patch the media module again. So closing up again. Jquery_update 2.4 would prolly fix this once released.

stefan.korn’s picture

It seems to me that it still does not work with the latest dev of jquery update: 7.x-2.3+6-dev.

Is there some place I can find a newer dev version?

OnkelTem’s picture

Status:Closed (works as designed)» Active

Actually, jQuery Update has nothing to do with API. It had changed and can't magically start working :)

Btw, there is one more issue with the latest Media dev version:

<?php
Drupal
.media.browser.selectActiveTab = function() {
 
// Find the index of the last active tab.
 
setTimeout(function() {
    $(
'#media-browser-tabset').tabs('select', Drupal.media.browser.activeTab); // problem
   
Drupal.media.browser.resizeIframe();
  },
10);
};
?>

The line marked "problem" should read as:

<?php
$('#media-browser-tabset').tabs('option', 'active', Drupal.media.browser.activeTab);
?>

to work on latest jQuery UI.

sylus’s picture

Status:Active» Needs review
StatusFileSize
new1001 bytes
PASSED: [[SimpleTest]]: [MySQL] 92 pass(es).
[ View ]

Attaching updated patch based on discussion above.

sylus’s picture

StatusFileSize
new1001 bytes
PASSED: [[SimpleTest]]: [MySQL] 92 pass(es).
[ View ]

Whoops removed extra underscore.

sylus’s picture

StatusFileSize
new1.03 KB
PASSED: [[SimpleTest]]: [MySQL] 92 pass(es).
[ View ]

Adding the create from comment: #2

Everything is resizing and working perfectly now :)

Should be good to go.

OnkelTem’s picture

Status:Needs review» Needs work

Note that you just deleted:
-    $('#media-browser-tabset').tabs('select', Drupal.media.browser.activeTab);
and added:
+    $('#media-browser-tabset').tabs('option', 'active', Drupal.media.browser.activeTab);
which is not compatible with ancient Drupal 7 jQuery :)

sylus’s picture

Oh I didn't even realize that thanks for the catch! How would you recommend solving this?

OnkelTem’s picture

I'm not aware of a common Drupal way for doing this. I would check $.ui.version, maybe something like:

<?php
  setTimeout
(function() {
    var
ver = jQuery.ui.version.split('.');
    (
ver[0] == '1' && parseInt(ver[1]) >= 10 ?
      $(
'#media-browser-tabset').tabs('option', 'active', Drupal.media.browser.activeTab) :
      $(
'#media-browser-tabset').tabs('select', Drupal.media.browser.activeTab);
  },
10);
?>
ianthomas_uk’s picture

Status:Needs work» Closed (duplicate)

The issue described is the same as https://drupal.org/node/2032255 which has a patch for both versions of jQuery UI.

The issue that the second half of the patch is attempting to fix is a separate incompatibility, so I've raised a new issue for that - https://drupal.org/node/2089913

ianthomas_uk’s picture

I've uploaded a patch to https://drupal.org/node/2089913

ianthomas_uk’s picture

Issue summary:View changes

Updated issue summary.