PHP Snippet 1:
var config = {
"map": {
"*": {
"mage/collapsible": "js/collapsible-custom"
}
}
};
PHP Snippet 2:
define([
'jquery',
'jquery/ui'
], function ($, wrapper) {
'use strict';
return function(target) {
$.widget("mage.myCollapsible", target, {
activate: function () {
if (!this.options.disabled) {
if (this.options.animate) {
this._animate(showProps);
} else {
// custom code goes here ...
this.content.show();
}
this._open();
}
// Or:
// this._super();
// if (!this.options.disabled) { .. custom code .. }
}
});
};
});
PHP Snippet 3:
var config = {
config: {
mixins: {
'mage/collapsible': {
'mage/my-collapsible-mixin': true
}
}
}
};
PHP Snippet 4:
define([
'jquery'
], function ($) {
'use strict';
return function(widget) {
$.widget('mage.collapsible', widget, {
activate: function () {
if (!this.options.disabled) {
if (this.options.animate) {
this._animate(showProps);
} else {
// custom code goes here ...
this.content.show();
}
this._open();
}
}
});
return $.mage.collapsible;
};
});
PHP Snippet 5:
var config = {
config: {
mixins: {
'mage/collapsible': {
'Vendor_Modulename/js/lib/mage/collapsible-mixin': true
}
}
}
};
PHP Snippet 6:
define([
'jquery'
], function ($) {
'use strict';
return function(originalWidget) {
$.widget('mage.collapsible', $.mage.collapsible, {
_scrollToTopIfNotVisible: function () {
console.log('Mixin Loaded');
}
});
return $.mage.collapsible;
};
});