silverstripe-framework/admin/client/src/legacy/ToggleCompositeField.js
Ingo Schommer 8f23fa99a5 API Moved CMS-specific JavaScript to admin/thirdparty
The 'admin' module will be split off from 'framework',
where 'framework' only provides (mostly) frontend-agnostic PHP classes.
For example, HTMLEditorField.php has a TinyMCEConfig.php driver,
but doesn't come with its own JS includes.
2016-09-16 13:46:10 +12:00

36 lines
883 B
JavaScript

import $ from 'jQuery';
// entwine also required, but can't be included more than once without error
require('../../../thirdparty/jquery-ui/jquery-ui.js');
// TODO Enable once https://github.com/webpack/extract-text-webpack-plugin/issues/179 is resolved. Included in bundle.scss for now.
// require('../../../thirdparty/jquery-ui-themes/smoothness/jquery-ui.css');
$.entwine('ss', function($){
$('.ss-toggle').entwine({
onadd: function() {
this._super();
this.accordion({
heightStyle: "content",
collapsible: true,
active: (this.hasClass("ss-toggle-start-closed")) ? false : 0
});
},
onremove: function() {
if (this.data('accordion')) this.accordion('destroy');
this._super();
},
getTabSet: function() {
return this.closest(".ss-tabset");
},
fromTabSet: {
ontabsshow: function() {
this.accordion("resize");
}
}
});
});