| Current Path : /proc/thread-self/cwd/static/frontend/Magento/luma/it_IT/Magento_Wishlist/js/ |
| Current File : //proc/thread-self/cwd/static/frontend/Magento/luma/it_IT/Magento_Wishlist/js/search.js |
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
define([
'jquery',
'jquery-ui-modules/widget'
], function ($) {
'use strict';
$.widget('mage.wishlistSearch', {
/**
* Bind handlers to events
*/
_create: function () {
this.element.on('change', $.proxy(this._toggleForm, this));
},
/**
* Toggle Form
* @private
*/
_toggleForm: function () {
switch (this.element.val()) {
case 'name':
$(this.options.emailFormSelector).hide();
$(this.options.nameFormSelector).show();
break;
case 'email':
$(this.options.nameFormSelector).hide();
$(this.options.emailFormSelector).show();
break;
default:
$(this.options.emailFormSelector).add(this.options.nameFormSelector).hide();
}
}
});
return $.mage.wishlistSearch;
});