Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ENHANCEMENT: Make ToggleCompositeField use new entwine features

  • Loading branch information...
commit e58929d52c93d7922d2408f774e43465f72d8bf8 1 parent b86a787
@hafriedlander hafriedlander authored chillu committed
Showing with 16 additions and 15 deletions.
  1. +16 −15 javascript/ToggleCompositeField.js
View
31 javascript/ToggleCompositeField.js
@@ -1,25 +1,26 @@
(function($){
$.entwine('ss', function($){
$('.ss-toggle').entwine({
- onmatch: function() {
- var self = $(this);
- var opts = { collapsible: true };
- var tab = self.parents(".ss-tabset");
+ onadd: function() {
+ opts = {collapsible: true};
+ if (this.hasClass("ss-toggle-start-closed")) opts.active = false;
- if(self.hasClass("ss-toggle-start-closed")) {
- opts.active = false;
- }
+ this.accordion({ collapsible: true });
- if(tab.length) {
- tab.bind("tabsshow", function() {
- self.accordion("resize");
- });
- }
+ this._super();
+ },
+ onremove: function() {
+ this.accordion('destroy');
+ },
- this.accordion(opts);
+ getTabSet: function() {
+ return this.closest(".ss-tabset");
},
- onunmatch: function() {
- this._super();
+
+ fromTabSet: {
+ ontabsshow: function() {
+ this.accordion("resize");
+ }
}
});
});
Please sign in to comment.
Something went wrong with that request. Please try again.