Merge branch 'fixbug-1549' of https://github.com/alexgleason/wagtail into alexgleason-fixbug-1549

pull/1821/head
Matt Westcott 2015-10-13 00:06:00 +01:00
commit 1ef376e6b3
1 zmienionych plików z 10 dodań i 1 usunięć

Wyświetl plik

@ -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();
}