make DocPage more like ExamplePage

This commit is contained in:
rolux 2012-04-05 17:31:32 +02:00
parent e951578b37
commit 5c727a1687

View file

@ -16,22 +16,64 @@ Ox.DocPage = function(options, self) {
item: {} item: {}
}) })
.options(options || {}) .options(options || {})
.addClass('OxDocPage OxDocument')
.css({ .css({
overflow: 'auto' overflow: 'auto'
}); });
that.append( self.$toolbar = Ox.Bar({size: 24});
$('<h1>')
.css({ self.$title = Ox.Label({
marginTop: 0, style: 'square',
WebkitMarginBefore: 0 title: 'Documentation: ' + self.options.item.name
}) })
.html('<code>' + self.options.item.name + '</code>') .css({float: 'left', margin: '4px'})
); .appendTo(self.$toolbar)
self.$examplesMenu = Ox.MenuButton({
items: [
{id: 'foo', title: 'Not yet...', disabled: true}
],
title: 'Examples...',
width: 128
})
.css({float: 'right', margin: '4px 4px 4px 2px'})
.bindEvent({
click: function(data) {
that.triggerEvent('select', {id: data.id});
}
})
.appendTo(self.$toolbar);
self.$referencesMenu = Ox.MenuButton({
items: [
{id: 'foo', title: 'Not yet...', disabled: true}
],
title: 'References...',
width: 128
})
.css({float: 'right', margin: '4px 2px 4px 2px'})
.bindEvent({
click: function(data) {
that.triggerEvent('select', {id: data.id});
}
})
.appendTo(self.$toolbar);
self.$page = Ox.Container()
.addClass('OxDocPage OxDocument');
that.setElement(
Ox.SplitPanel({
elements: [
{element: self.$toolbar, size: 24},
{element: self.$page}
],
orientation: 'vertical'
})
)
getItem(self.options.item, 0).forEach(function($element) { getItem(self.options.item, 0).forEach(function($element) {
that.append($element); self.$page.append($element);
}); });
function getItem(item, level, name) { function getItem(item, level, name) {