![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/wyomind/msicustomattributes/view/adminhtml/web/js/form/element/ |
/* * Copyright © 2020 Wyomind. All rights reserved. * See LICENSE.txt for license details. */ define([ 'jquery', 'Magento_Ui/js/form/element/select' ], function ($, checkbox) { 'use strict'; return checkbox.extend({ initialize: function () { this._super(); $(document).on('click', "div.fieldset-wrapper", function () { this.onUpdate(this.value()); }.bind(this)); this.waitFor("SELECT[name='type']", function () { this.showHide(this.value()); }.bind(this)) return this; }, waitFor: function (elt, callback) { var initializer = null; initializer = setInterval(function () { if ($(elt).length > 0) { callback(); clearInterval(initializer); } }, 100); }, /** * @param value *@returns {*} */ onUpdate: function (value) { this.showHide(value); return this._super(); }, showHide: function (value) { $(".depends_type_value_" + value).show(); $(".depends_type_value_not_" + value).hide(); } }); });