mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-12 01:03:11 +00:00
Merge branch 'fixbug-1549' of https://github.com/alexgleason/wagtail into alexgleason-fixbug-1549
This commit is contained in:
commit
1ef376e6b3
1 changed files with 10 additions and 1 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue