04.07.2019 Views

frontend-developer-1

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Customize and Create JavaScript<br />

);<br />

return jQuery['mage']['tabs'];<br />

}<br />

});<br />

Many thanks to Alan Storm’s article on this subject which makes it very clear on how<br />

to do this.<br />

Here is an example on how to add a new method to a Magento<br />

jQuery UI widget by creating a new widget that extends another<br />

widget:<br />

// app/code/SwiftOtter/Test/view/<strong>frontend</strong>/web/js/customtabs.js<br />

define([<br />

'jquery',<br />

'jquery/ui',<br />

'mage/tabs'<br />

], function($) {<br />

$.widget('swiftotter.customTabs', $.mage.tabs, {<br />

doSomething: function(input) {<br />

Copyright © 2018, SwiftOtter, Inc.<br />

74

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!