plots2 icon indicating copy to clipboard operation
plots2 copied to clipboard

Photos in galleries in old research notes do not display in popup

Open Fastie opened this issue 9 years ago • 25 comments

Research notes once had galleries of images. These were ported to the plots2 site and appear as a row of icons at the top of some old notes. Clicking on these thumbnails would pop up each photo. Now those photos do not pop up.

Example URLs https://publiclab.org/notes/elainechoi89/7-5-2012/tyvekbamboo-kite-workshop-pfizer-building-brooklyn-ny https://publiclab.org/notes/cfastie/4-14-2013/sanm-leafkam

PublicLab.org username cfastie

Browser, version, and operating system Chrome or IE in Windows

Fastie avatar Dec 22 '16 01:12 Fastie

These used a JavaScript plugin, so is it possible to look in the JavaScript console to see if there are any errors?

Thanks!

On Dec 21, 2016 8:20 PM, "Fastie" [email protected] wrote:

Research notes once had galleries of images. These were ported to the plots2 site and appear as a row of icons at the top of some old notes. Clicking on these thumbnails would pop up each photo. Now those photos do not pop up.

Example URLs https://publiclab.org/notes/elainechoi89/7-5-2012/ tyvekbamboo-kite-workshop-pfizer-building-brooklyn-ny https://publiclab.org/notes/cfastie/4-14-2013/sanm-leafkam

PublicLab.org username cfastie

Browser, version, and operating system Chrome or IE in Windows

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/1135, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJyehbdugD_A75jFh2pUar6dF9Y_Cks5rKdBdgaJpZM4LTi_i .

jywarren avatar Dec 22 '16 13:12 jywarren

@jywarren Anyone working on this?

ryzokuken avatar Dec 29 '16 01:12 ryzokuken

Not that I know of! Go for it.

On Dec 28, 2016 8:57 PM, "Ujjwal Sharma" [email protected] wrote:

@jywarren https://github.com/jywarren Anyone working on this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/1135#issuecomment-269570609, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJy4RZn55UnoT-AtHFEVdISrN0NYqks5rMxOYgaJpZM4LTi_i .

jywarren avatar Dec 29 '16 15:12 jywarren

@jywarren The screen grows dark (as if the picture loaded in the foreground) but the picture does not show up. There are no errors on the JS Console. Also, you can "turn off" the picture by clicking on the page again.

ryzokuken avatar Dec 29 '16 16:12 ryzokuken

Can you monitor the "network" pane of the chrome dev tools to see if any image file is loaded, but not shown? And, can you double check the JavaScript that's being used to trigger the show, that it's correctly formatted? Perhaps you could try to trigger it yourself from the JavaScript console to test that out.

On Dec 29, 2016 11:37 AM, "Ujjwal Sharma" [email protected] wrote:

@jywarren https://github.com/jywarren The screen grows dark (as if the picture loaded in the foreground) but the picture does not show up. There are no errors on the JS Console. Also, you can "turn off" the picture by clicking on the page again.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/1135#issuecomment-269656338, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJxBaJbYxJoAnPq_KUcofhqPP0Guwks5rM-G7gaJpZM4LTi_i .

jywarren avatar Dec 29 '16 16:12 jywarren

@jywarren Nope, it's preloading all the images and then must be trying to show them later but with no avail. In my case, all the images (yes, the images not the thumbnails. I checked :P) loaded almost as soon as the page did.

ryzokuken avatar Dec 29 '16 16:12 ryzokuken

Hmm, use the Dom inspector to inspect the elements themselves and see why they're not showing?

On Dec 29, 2016 11:47 AM, "Ujjwal Sharma" [email protected] wrote:

@jywarren https://github.com/jywarren Nope, it's preloading all the images and then must be trying to show them later but with no avail. In my case, all the images (yes, the images not the thumbnails. I checked :P) loaded almost as soon as the page did.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/1135#issuecomment-269657794, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJ5KDFCh-I-e0U4u1M2EPsfDse8n4ks5rM-QqgaJpZM4LTi_i .

jywarren avatar Dec 29 '16 16:12 jywarren

@jywarren screenshot_20170102_212238 If you notice, the display: block property is crossed out. This is because it is being overridden by another rule. Quite evidently, it is the rule for the class .hide. Not only is it above the element rule because of precedence, it has this pesky !important modifier which automatically puts this rule above every other rule. Perhaps we should try changing these rules a little, they would most probably fix our issue.

ryzokuken avatar Jan 02 '17 15:01 ryzokuken

Oh, good find! Can you see where the .hide class is defined in /app/assets/stylesheets/ (or maybe in a library dependency?), and perhaps we can disambiguate it? I think it'll have been compiled into application-xxxxxxxx.css but in development mode you'd see the uncompiled version.

On Mon, Jan 2, 2017 at 10:59 AM, Ujjwal Sharma [email protected] wrote:

@jywarren https://github.com/jywarren [image: screenshot_20170102_212238] https://cloud.githubusercontent.com/assets/13121330/21592244/e7f07bde-d131-11e6-852d-f3a376334e12.png If you notice, the display: block property is crossed out. This is because it is being overridden by another rule. Quite evidently, it is the rule for the class .hide. Not only is it above the element rule because of precedence, it has this pesky !important modifier which automatically puts this rule above every other rule. Perhaps we should try changing these rules a little, they would most probably fix our issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/1135#issuecomment-269989988, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJ7VmcgSZTc6bLqpcnE4r9_2uXcVCks5rOR7fgaJpZM4LTi_i .

jywarren avatar Jan 03 '17 15:01 jywarren

@jywarren Can I reproduce this issue locally? If these are the old notes, maybe I cannot recreate them. Nevertheless, I'll look for this class in the css.

ryzokuken avatar Jan 04 '17 14:01 ryzokuken

@jywarren What is the name of the javascript library? None of our own CSS files contain such a class. Apparently, we cannot (and ideally should not change the CSS rules in libraries). Also, the element is working properly, even changing the display property of the element on click. The .hide class is what changes things

ryzokuken avatar Jan 04 '17 14:01 ryzokuken

Ah, this is true about locally... ummmm. things that are hard to reproduce are hard to solve!

I /think/ the library is included via bower.json:

"bootstrap-lightbox": "jbutz/bootstrap-lightbox#~0.5.0",

jywarren avatar Jan 04 '17 15:01 jywarren

the style is in /public/lib/boostrap-lightbox/less/

jywarren avatar Jan 04 '17 15:01 jywarren

Perhaps we could swap for a different "lightbox"-style plugin that doesn't use that. But I'd guess the conflicting style is from the main bootstrap library, so maybe this is a version mismatch issue?

jywarren avatar Jan 04 '17 15:01 jywarren

(trusty)warren@localhost:~/sites/plots2$ grep -r '.hide' public/lib/bootstrap/less/
public/lib/bootstrap/less/modals.less:// Measure scrollbar width for padding body during modal show/hide
public/lib/bootstrap/less/scaffolding.less:// See: http://a11yproject.com/posts/how-to-hide-content/
public/lib/bootstrap/less/button-groups.less:// `required` attribute, we have to "hide" the inputs via `opacity`. We cannot
public/lib/bootstrap/less/button-groups.less:// use `display: none;` or `visibility: hidden;` as that also hides the popover.
public/lib/bootstrap/less/mixins.less:@import "mixins/hide-text.less";
public/lib/bootstrap/less/mixins/hide-text.less:// Heads up! v3 launched with with only `.hide-text()`, but per our pattern for
public/lib/bootstrap/less/mixins/hide-text.less:// of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`.
public/lib/bootstrap/less/mixins/hide-text.less:.hide-text() {
public/lib/bootstrap/less/mixins/hide-text.less:.text-hide() {
public/lib/bootstrap/less/mixins/hide-text.less:  .hide-text();
public/lib/bootstrap/less/utilities.less:// Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1
public/lib/bootstrap/less/utilities.less:.hide {
public/lib/bootstrap/less/utilities.less:.text-hide {
public/lib/bootstrap/less/utilities.less:  .text-hide();

This line sticks out to me:

public/lib/bootstrap/less/utilities.less:// Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1

jywarren avatar Jan 04 '17 15:01 jywarren

Indeed, there have been releases since we included it: v0.7.0:

jywarren avatar Jan 04 '17 15:01 jywarren

https://github.com/jbutz/bootstrap-lightbox/releases -- maybe we should upgrade?

jywarren avatar Jan 04 '17 15:01 jywarren

.hide is no longer used: https://github.com/jbutz/bootstrap-lightbox/blob/master/less/bootstrap-lightbox.less

last update was for Bootstrap 3.1 compatibility.

jywarren avatar Jan 04 '17 15:01 jywarren

So let's bump to v0.7.0 and see what happens in staging server?

http://testing.laboratoriopublico.org (once we merge to stable it'll publish there)

jywarren avatar Jan 04 '17 15:01 jywarren

@jywarren so, do I make a small PR for this, changing the line https://github.com/publiclab/plots2/blob/master/bower.json#L7? Going to bed today, but will do whatever works for you tomorrow. :)

ryzokuken avatar Jan 04 '17 17:01 ryzokuken