Skip to content

Commit

Permalink
Add clickable initial location request button
Browse files Browse the repository at this point in the history
This adds a prominent button for choosing the location
of the item you want to request.
  • Loading branch information
little9 committed Jan 23, 2024
1 parent 217c20e commit 6a9d3db
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
17 changes: 17 additions & 0 deletions 01JHU_INST-JHU/html/prm-location-after.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<style>
.location-after-request-button {
color: #fff;
background-color: #002d72;
padding: 1em;
padding-left: 2.5em;
padding-right: 2.5em;
border-radius: .2em;
margin-top: 0;
margin-bottom: 1em;
margin-right: 1em;
min-width: 285px;
float: right;
cursor: pointer;
}
</style>
<div class="location-after-request-button" ng-click="$ctrl.requestFromThisLocation($event)">Request item from this location</div>
25 changes: 24 additions & 1 deletion 01JHU_INST-JHU/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

var app = angular.module('viewCustom', ['angularLoad']);

app.component('prmSearchBookmarkFilterAfter', {
app.component('prmSearchBookmarkFilterAfter', {
template: `
<help-menu-topbar>
<a class="md-icon-button button-over-dark md-button md-primoExplore-theme md-ink-ripple"
Expand Down Expand Up @@ -33,4 +33,27 @@
bindings: { parentCtrl: `<` },
templateUrl: "/discovery/custom/01JHU_INST-JHU/html/prm-search-result-thumbnail-container-after.html"
});

app.component('prmLocationAfter', {
bindings: { parentCtrl: `<` },
templateUrl: "/discovery/custom/01JHU_INST-JHU/html/prm-location-after.html",
controller: function () {

this.requestFromThisLocation = function (e) {
console.log("requestFromThisLocation")
var clickedElement = e.target;

var requestButton = clickedElement.parentElement.parentElement.firstChild;
console.log(requestButton);

if (requestButton) {
requestButton.click();
} else {
console.log('No clickable location found');
}

};
}
});

})();

0 comments on commit 6a9d3db

Please sign in to comment.