diff --git a/js/modules/prm-alma-viewit-items-after/slsp-icon-label-viewit-items/slsp-icon-label-viewit-items.controller.js b/js/modules/prm-alma-viewit-items-after/slsp-icon-label-viewit-items/slsp-icon-label-viewit-items.controller.js index 2e90cea..eaba8d6 100644 --- a/js/modules/prm-alma-viewit-items-after/slsp-icon-label-viewit-items/slsp-icon-label-viewit-items.controller.js +++ b/js/modules/prm-alma-viewit-items-after/slsp-icon-label-viewit-items/slsp-icon-label-viewit-items.controller.js @@ -7,46 +7,42 @@ export class slspIconLabelViewitItemsController { } $onInit() { - this.$timeout(() => { - this.parentCtrl = this.afterCtrl.parentCtrl - - if (this.parentCtrl.serviceType == "ELECTRONIC") { - this.iconLabelViewitItems = iconLabelViewitItems - let iconLabelViewitItems = document.querySelectorAll("#getit_link1_0 > div > prm-full-view-service-container > div.section-body > div > prm-alma-viewit > prm-alma-viewit-items:nth-child(1) > md-list") - let htmlViewitItems = ` + this.$timeout(() => { + this.parentCtrl = this.afterCtrl.parentCtrl + if (this.parentCtrl.serviceType == "ELECTRONIC" || this.parentCtrl.serviceType == "DIGITAL") { + let iconLabelViewitItems = this.parentCtrl.$element[0].querySelector("md-list") + let htmlViewitItems = `
-
- - - -
+
+ + + + + + + + + + + + + + + + + +
` - let iconLabelRidOff = document.querySelectorAll(".icnWrp:nth-child(2)") - angular.element(iconLabelRidOff).detach() - angular.element(iconLabelViewitItems).prepend(this.$compile(htmlViewitItems)(this.$scope)).addClass('icnLblViewitItems') - } - else if (this.parentCtrl.serviceType == "DIGITAL") { - this.iconLabelViewitItemsDigital = iconLabelViewitItemsDigital - let iconLabelViewitItemsDigital = document.querySelectorAll("#getit_link1_0>div>prm-full-view-service-container>div.section-body>div>prm-alma-viewit>prm-alma-viewit-items:nth-child(2)>md-list") - let htmlViewitItemsDigital = ` -
-
- - - -
-
-
` - let iconLabelRidOffDigital = document.querySelectorAll(".icnWrp:nth-child(2)") - angular.element(iconLabelRidOffDigital).detach() - angular.element(iconLabelViewitItemsDigital).prepend(this.$compile(htmlViewitItemsDigital)(this.$scope)).addClass('icnLblViewitItemsDigital') - } - else { - return - } - }, 0) - } + let iconLabelRidOff = document.querySelectorAll(".icnWrp:nth-child(2)") + angular.element(iconLabelRidOff).detach() + angular.element(iconLabelViewitItems).prepend(this.$compile(htmlViewitItems)(this.$scope)).addClass('icnLblViewitItems') + } + else { + return + } + }, 0) + } } slspIconLabelViewitItemsController.$inject = ['$scope', '$compile', '$timeout']