Bugzilla – Attachment 130878 Details for
Bug 29845
Styling OverDrive buttons is difficult
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29845: add classes to overdrive results action buttons
Bug-29845-add-classes-to-overdrive-results-action-.patch (text/plain), 3.11 KB, created by
Nick Clemens (kidclamp)
on 2022-02-18 17:00:30 UTC
(
hide
)
Description:
Bug 29845: add classes to overdrive results action buttons
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-02-18 17:00:30 UTC
Size:
3.11 KB
patch
obsolete
>From adcd1edc3a8bd015005dac8f6ff6d8bfdbfff247 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 15 Feb 2022 17:59:47 +0000 >Subject: [PATCH] Bug 29845: add classes to overdrive results action buttons > >To test: >1. You must have OverDrive credentials populated in the OverDrive > system preferences >2. Go to the Overdrive results page and make sure you are logged in. >3. Use your browsers dev tools to look at the check-in, check-out, > place hold, cancel hold buttons, none of them contain classes. >4. Apply patch >5. Repeat 3 again but this time they should all contain a class which > makes them much easier to style. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js b/koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js >index 2dd332ea2c..7cf4237436 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js >@@ -302,7 +302,7 @@ KOHA.OverDriveCirculation = new function() { > if( confirm( __("Are you sure you want to return this item?") ) ) { > item_action({action: "return", id: id}, el, copies_available + 1); > } >- }) ); >+ }, "checkin") ); > > return item; > } >@@ -343,12 +343,12 @@ KOHA.OverDriveCirculation = new function() { > } > }); > } >- }) ); >+ }, "checkout") ); > } > else if (!item) { > $(el).append( ajax_button( __("Place hold"), function() { > item_action({action: "place-hold", id: id}, el, copies_available); >- }) ); >+ }, "placehold") ); > } > > if (item) { >@@ -356,27 +356,28 @@ KOHA.OverDriveCirculation = new function() { > if( confirm( __("Are you sure you want to cancel this hold?") ) ) { > item_action({action: "remove-hold", id: id}, el, copies_available); > } >- }) ); >+ }, "cancelhold") ); > } > return item; > } > } > >- function ajax_button(label, on_click) { >+ function ajax_button(label, on_click, uniqueName) { > var button = $('<a href="#">') > .click(function(e) { > e.preventDefault(); > on_click(); > }); >- decorate_button(button, label); >+ decorate_button(button, label, uniqueName); > return button; > } > >- function decorate_button(button, label) { >+ function decorate_button(button, label, uniqueName) { > $(button) > .addClass("btn btn-primary btn-sm") > .css("color","white") >- .text(label); >+ .text(label) >+ .addClass(uniqueName); > } > > function checkout_format(el, id, formats, copies_available) { >-- >2.30.2
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 29845
:
129288
|
129324
|
129332
|
130633
|
130634
|
130662
| 130878