Problem/Motivation

The media browser does not support double clicking in the library to select files. This patch adds that functionality.

Proposed resolution

The forthcoming patch will cause a double-click event in the media library to select & submit media.

Remaining tasks

(done) write patch
(done) test the patch

User interface changes

Adds double-click support in the media browser library.

API changes

Files: 
CommentFileSizeAuthor
#17 media-library-double-click-1024632-17.patch2.32 KBjonathan_hunt
PASSED: [[SimpleTest]]: [MySQL] 914 pass(es).
[ View ]
#14 media-library-double-click-1024632-3.patch953 bytesjerryitt
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]
#12 media-library-double-click-1024632-2.patch1.07 KBjerryitt
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]
#1 media-library-double-click.1024632.1.patch1.33 KBaaron
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch media-library-double-click.1024632.1.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.
[ View ]

Comments

aaron’s picture

Status:Active» Needs review
StatusFileSize
new1.33 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch media-library-double-click.1024632.1.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.
[ View ]
james.elliott’s picture

I'm concerned that with multi select turned on, clicking an already selected media item will deselect it. So the 2nd click that triggers the dblclick event might be unselecting the media item.

I'm also wondering how the UX for multiselect with this works. You can single click a bunch of items and then double click the last to select them all? Or should a double click unselect all the others and then submit only the singly selected item.

james.elliott’s picture

I'm concerned that with multi select turned on, clicking an already selected media item will deselect it. So the 2nd click that triggers the dblclick event might be unselecting the media item.

I'm also wondering how the UX for multiselect with this works. You can single click a bunch of items and then double click the last to select them all? Or should a double click unselect all the others and then submit only the singly selected item.

aaron’s picture

I'd originally had the double click also trigger the click behavior, but found that unnecessary in testing (at least in linux/ff). Easy enough to put that back in if other browsers de-select during a double-click.

I didn't test against multi-select, however. IMHO, I think that a double-click should submit only the singly selected item. Where do we get multi-select? Is that in the media admin browsing? I'll take a look shortly.

james.elliott’s picture

The multi-select is used in the media browser library tab. Some implementations, such as a multi value media field benefitted from being able to add multiple media items at once. It allows you to select and unselect media items and then add them by clicking submit.

I agree on the dblclick behavior in a multi select context. Only the item you are double clicking should be selected.

effulgentsia’s picture

Subscribe. I don't have much to add here. Just want to know what you two end up deciding.

arthurf’s picture

Version:7.x-1.x-dev» 7.x-2.x-dev

Moving this to a 7.x-2.x feature request- this would need to be tested against the views implementation.

arthurf’s picture

Status:Needs review» Needs work

The last submitted patch, media-library-double-click.1024632.1.patch, failed testing.

rudiedirkx’s picture

(I'm nobody, but) I agree that the double click should trigger the submit and that a multi selection shouldn't be the default (if possible at all). The library selection feels very natural, except for that one thing: double click to choose.

I can't find any multi selection, though I'm new to the media module, so that's not saying much.

Dave Reid’s picture

Component:Code» Media Browser
jerryitt’s picture

Status:Needs work» Needs review
StatusFileSize
new1.07 KB
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

This patch allows double click on media in the media library, it works against the current 7.x-2.x pull.

bleen18’s picture

Status:Needs review» Needs work
+++ b/js/plugins/media.library.jsundefined
@@ -134,10 +133,13 @@ Drupal.media.browser.library.prototype.render = function (renderElement) {
+   // Below lines should handle double click submitting.

Please replace your TAB with double spaces

+++ b/js/plugins/media.library.jsundefined
@@ -134,10 +133,13 @@ Drupal.media.browser.library.prototype.render = function (renderElement) {
-      .bind('click', data, this.clickFunction);
+      .bind('dblclick', data, this.dblclickSubmit)
+      .bind('click', data, this.clickFunction)

what happened to the ";" that used to be there?

Also, you should have a new line at the end of this file.

jerryitt’s picture

Status:Needs work» Needs review
StatusFileSize
new953 bytes
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

@bleen18 thanks for pointing that out to me. I have made the changes to the patch in #12.

Here's the new one.

dddave’s picture

Folks, this patch is actually working. Just applied it and now I am happily testing it and it seems to work fine. From a functionality standpoint this is fine. Guess somebody should check if the code is fine enough.

ParisLiakos’s picture

Status:Needs review» Needs work

file in patch is now removed..please an updated patch for views browser?

jonathan_hunt’s picture

Issue summary:View changes
Status:Needs work» Needs review
StatusFileSize
new2.32 KB
PASSED: [[SimpleTest]]: [MySQL] 914 pass(es).
[ View ]

I've reworked this to function on 7.x-2.x-dev by copying some of the logic for single click and adding a new function Drupal.media.browser.selectMediaAndSubmit().

svenryen’s picture

Issue summary:View changes
Status:Needs review» Reviewed & tested by the community

I tested the patch in #17 in Safari, Firefox and Chrome on Mac.

Double-clicking on an image in the Media Browser Library works in all the browsers.

I also read through the code and it looks ready to be committed.
This is a nice feature to add to the library! :)

aaron’s picture

Status:Reviewed & tested by the community» Fixed

Status:Fixed» Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

chrisgross’s picture

What version of Firefox was this tested with? It doesn't work on 34.0.5 on OS X.

svenryen’s picture

I don't remember what version of Firefox was used. Now my Firefox is also at 34.0.5 though I'm not sure what version I used in October. Did you apply the patch or did you simply try with the latest dev of the code?

chrisgross’s picture

Ah, I had only tried to dev version. I guess I thought #19 meant it had been commited to dev, but perhaps not. Looks like the patch works fine.