Bugzilla – Attachment 17553 Details for
Bug 8264
local cover images not working in IE8
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8264 - local cover images not working in IE8 [ prog ]
Bug-8264---local-cover-images-not-working-in-IE8--.patch (text/plain), 3.64 KB, created by
Kyle M Hall (khall)
on 2013-04-19 14:03:38 UTC
(
hide
)
Description:
Bug 8264 - local cover images not working in IE8 [ prog ]
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-04-19 14:03:38 UTC
Size:
3.64 KB
patch
obsolete
>From b70fdf21e47384fae60c84f0fb4baf7699d9a285 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Mon, 15 Apr 2013 11:08:06 +1000 >Subject: [PATCH] Bug 8264 - local cover images not working in IE8 [ prog ] > >Edmund, rather than myself, was the author of this patch, so I'm not entirely sure about his code choices, but...it looks like IE must process images differently than other browsers. > >It seems to me that the images are not appearing in IE, because they're being regarded as incomplete or having 0/NULL natural width. > >This patch simply introduces a try/catch hack where it tries to add the image and remove any "no-image" elements even when the image is considered incomplete/width of 0/NULL. It won't do this if it catches any errors, although I'm not sure that any errors would be caught with this set up anyway... > >It's certainly not the ideal solution, but it's a solution. > >To Test: > >Before applying the patch: >1) Use IE and FF/Chrome/other browser to view a record with local images attached >2) Note that the local images appear in FF/Chrome/other, but not in IE > >Apply patch. > >After applying the patch: >1) Repeat step 1 from above >2) Note that the local images now appear in all browsers as they should. > >-- > >As I mentioned before, this seems like a real suboptimal solution. Any ideas on why IE might be considering local images to be incomplete or having 0/NULL natural width? > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js | 7 +++++++ > koha-tmpl/opac-tmpl/prog/en/js/localcovers.js | 7 +++++++ > 2 files changed, 14 insertions(+), 0 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js b/koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js >index 981af75..f044f62 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js >@@ -28,6 +28,13 @@ KOHA.LocalCover = { > '/cgi-bin/koha/catalogue/image.pl?thumbnail=1&biblionumber=' + $(mydiv).attr("class")) > .load(function () { > if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) { >+ //IE HACK >+ try { >+ $(mydiv).append(img); >+ $(mydiv).children('.no-image').remove(); >+ } >+ catch(err){ >+ } > } else { > if (uselink) { > var a = $("<a />").attr('href', '/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=' + $(mydiv).attr("class")); >diff --git a/koha-tmpl/opac-tmpl/prog/en/js/localcovers.js b/koha-tmpl/opac-tmpl/prog/en/js/localcovers.js >index f2808ef..6d24798 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/js/localcovers.js >+++ b/koha-tmpl/opac-tmpl/prog/en/js/localcovers.js >@@ -28,6 +28,13 @@ KOHA.LocalCover = { > '/cgi-bin/koha/opac-image.pl?thumbnail=1&biblionumber=' + $(mydiv).attr("class")) > .load(function () { > if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) { >+ //IE HACK >+ try { >+ $(mydiv).append(img); >+ $(mydiv).children('.no-image').remove(); >+ } >+ catch(err){ >+ }; > } else { > if (uselink) { > var a = $("<a />").attr('href', '/cgi-bin/koha/opac-imageviewer.pl?biblionumber=' + $(mydiv).attr("class")); >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8264
:
10350
|
10351
|
10352
|
17431
|
17553
|
17749