make DocPage more like ExamplePage
This commit is contained in:
parent
e951578b37
commit
5c727a1687
1 changed files with 52 additions and 10 deletions
|
@ -16,22 +16,64 @@ Ox.DocPage = function(options, self) {
|
|||
item: {}
|
||||
})
|
||||
.options(options || {})
|
||||
.addClass('OxDocPage OxDocument')
|
||||
.css({
|
||||
overflow: 'auto'
|
||||
});
|
||||
|
||||
that.append(
|
||||
$('<h1>')
|
||||
.css({
|
||||
marginTop: 0,
|
||||
WebkitMarginBefore: 0
|
||||
self.$toolbar = Ox.Bar({size: 24});
|
||||
|
||||
self.$title = Ox.Label({
|
||||
style: 'square',
|
||||
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) {
|
||||
that.append($element);
|
||||
self.$page.append($element);
|
||||
});
|
||||
|
||||
function getItem(item, level, name) {
|
||||
|
|
Loading…
Reference in a new issue