Skip to content

Commit

Permalink
Merge pull request #33 from HSG-Library/develop
Browse files Browse the repository at this point in the history
Implement fix for disabled rapido order button
  • Loading branch information
d22 authored Oct 4, 2023
2 parents 9f1a5b5 + 6a27bc0 commit 425ff0a
Showing 1 changed file with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,33 +1,38 @@
export class slspMultivolumeRequestController {
constructor($scope) {
this.$scope = $scope
this.previousUnavailableResource = null
this.previousUnavailableVolume = null
}

$doCheck() {
$onInit() {
this.parentCtrl = this.afterCtrl.parentCtrl
const currentUnavailableResource = this.parentCtrl.bestoffer.unavailableResource
if (currentUnavailableResource !== this.previousUnavailableResource) {
if (currentUnavailableResource !== false) {
}

$doCheck() {
const currentUnavailableVolume = this.parentCtrl.isNoOfferAfterRefine()
if (currentUnavailableVolume !== this.previousUnavailableVolume) {
if (currentUnavailableVolume == true) {
this.disableRequestButton()
} else {
this.enableRequestButton()
}
this.previousUnavailableResource = currentUnavailableResource

this.previousUnavailableVolume = currentUnavailableVolume
}

}

disableRequestButton() {
const requestButton = document.querySelector('button.button-with-icon.button-confirm.md-button.md-primoExplore-theme.md-ink-ripple')
const requestButton = angular.element(document.querySelector('button.button-with-icon.button-confirm.md-button.md-primoExplore-theme.md-ink-ripple'))
if (requestButton) {
requestButton.disabled = true
requestButton.attr('disabled', 'disabled')
}
}

enableRequestButton() {
const requestButton = document.querySelector('button.button-with-icon.button-confirm.md-button.md-primoExplore-theme.md-ink-ripple')
const requestButton = angular.element(document.querySelector('button.button-with-icon.button-confirm.md-button.md-primoExplore-theme.md-ink-ripple'))
if (requestButton) {
requestButton.disabled = false
requestButton.removeAttr('disabled')
}
}
}
Expand Down

0 comments on commit 425ff0a

Please sign in to comment.