Guest User

Untitled

a guest
Nov 13th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. (function () {
  2. "use strict";
  3. 'use strict';
  4.  
  5.  
  6. var app = angular.module('viewCustom', ['angularLoad']);
  7.  
  8. /****************************************************************************************************/
  9.  
  10. /*In case of CENTRAL_PACKAGE - comment out the below line to replace the other module definition*/
  11.  
  12. /*var app = angular.module('centralCustom', ['angularLoad']);*/
  13.  
  14. /****************************************************************************************************/
  15. app.controller('hideHtgController', function() {
  16. var vm = this;
  17. vm.item = vm.parentCtrl.item || false;
  18. vm.available = vm.item.delivery.availability[0] || false;
  19. vm.insts = vm.item.delivery.almaInstitutionsList || false;
  20. if (vm.available == "no_inventory" && vm.insts.length == 0) {
  21. // this code is executed if there is no IZ holding
  22. // and no other alma institution hodlings reported
  23. console.log("really not available, hiding howtogetit")
  24. //vm.item.delivery.GetIt1 = false;
  25. console.log(vm.item)
  26. }
  27. });
  28.  
  29. app.component('prmFullViewAfter', {
  30. bindings: {parentCtrl: '<'},
  31. controller: 'hideHtgController',
  32. });
  33.  
  34. app.controller('showILLNoHtg', function() {
  35. var vm = this;
  36. vm.item = vm.parentCtrl.item || false;
  37. vm.link = vm.item.delivery.link || false;
  38. if (vm.item.delivery.GetIt1 == false) {
  39. vm.show = true;
  40. } else {
  41. vm.show = false;
  42. }
  43. });
  44.  
  45. app.component('prmActionListAfter', {
  46. bindings: {parentCtrl: '<'},
  47. controller: 'showILLNoHtg',
  48. template: `<md-list ng-if="$ctrl.show" layout="column" class="separate-list-items md-primoExplore-theme layout-column" role="list">
  49. <md-list-item role="listitem" class="_md">
  50. <button class="neutralized-button layout-full-width layout-display-flex md-button md-ink-ripple md-primoExplore-theme" type="button">
  51. <div class="in-element-dialog-context layout-row flex" layout="row" flex="">
  52. <div class="md-list-item-text layout-wrap flex layout-row" layout="row">
  53. <div flex="" flex-xs="100" layout="column" class="layout-column flex-xs-100 flex">
  54. <span><a href="#">Request this item via ILL</a></span>
  55. </div>
  56. </div>
  57. </div>
  58. </button>
  59. </md-list-item>
  60. </md-list>`
  61. });
  62.  
  63. })();
Add Comment
Please, Sign In to add comment