Item Alternate Image Features in e-commerce site. (#15044)

* [ADD] Added Item Alternate Image Features in e-commerce site.

* [IMP] Improved Code for Item Alternate Image Feature.

* [IMP] Improved code for Item alternative image functionality.

* Remove .css file and make a build for erpnext-web.css

* Cleanup styling for item alternate image, also add delegated handler

* Spaces -> Tabs

* Spaces -> Tabs in item.html
This commit is contained in:
Solufyin
2018-08-07 18:28:39 +05:30
committed by Nabin Hait
parent 8f0acf30bf
commit 3be899caff
6 changed files with 187 additions and 412 deletions

View File

@@ -109,6 +109,13 @@ frappe.ready(function() {
window.location.href = window.location.pathname + "?variant=" + item_code;
});
// change the item image src when alternate images are hovered
$(document.body).on('mouseover', '.item-alternative-image', (e) => {
const $alternative_image = $(e.currentTarget);
const src = $alternative_image.find('img').prop('src');
$('.item-image img').prop('src', src);
});
});
var toggle_update_cart = function(qty) {