kopia lustrzana https://github.com/wagtail/wagtail
Merge branch 'fixbug-1549' of https://github.com/alexgleason/wagtail into alexgleason-fixbug-1549
commit
1ef376e6b3
|
@ -30,9 +30,18 @@
|
|||
self.container.addClass('stream-menu-closed');
|
||||
};
|
||||
|
||||
self.addFirstBlock = function() {
|
||||
if (opts.onChooseBlock) opts.onChooseBlock(opts.childBlocks[0]);
|
||||
};
|
||||
|
||||
self.toggle = function() {
|
||||
if (self.container.hasClass('stream-menu-closed')) {
|
||||
self.show();
|
||||
if (opts.childBlocks.length == 1) {
|
||||
/* If there's only one block type, add it automatically */
|
||||
self.addFirstBlock();
|
||||
} else {
|
||||
self.show();
|
||||
}
|
||||
} else {
|
||||
self.hide();
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue