1; (function (ng) { 2 'use strict'; 3 4 ng.module('quickview') 5 .directive('quickviewTrigger', ['domService', function (domService) { 6 return { 7 require: ['quickviewTrigger', '^productViewItem'], 8 restrict: 'A', 9 scope: true, 10 controller: 'QuickviewCtrl', 11 controllerAs: 'quickview', 12 bindToController: true, 13 link: function (scope, element, attrs, ctrls) { 14 element[0].addEventListener('click', function (event) { 15 16 event.preventDefault(); 17 event.stopPropagation(); 18 19 var quickviewCtrl = ctrls[0], productViewItemCtrl = ctrls[1], items, sibling, id; 20 21 if (quickviewCtrl.siblings == null) { 22 23 quickviewCtrl.siblings = []; 24 25 items = domService.closest(this, '.js-products-view-block').parentNode.children; 26 27 for (var i = 0, len = items.length - 1; i <= len; i++) { 28 29 sibling = items[i].querySelector('.js-products-view-item'); 30 31 if (sibling != null) { 32 33 id = parseInt(sibling.getAttribute('data-product-id')); 34 35 if (ng.isNumber(id)) { 36 quickviewCtrl.siblings.push(id); 37 } 38 } 39 } 40 } 41 42 quickviewCtrl.showModal(productViewItemCtrl.productId || parseInt(attrs.productId), productViewItemCtrl.getSelectedColorId(), attrs.quickviewTypeView, element[0].getAttribute('data-modal-class')); 43 44 scope.$apply(); 45 }); 46 } 47 } 48 }]); 49 50})(window.angular);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.