add home button to doc page and example page

This commit is contained in:
rolux 2012-06-18 10:57:52 +02:00
parent 3286d80b40
commit ba1a3c4b2a
4 changed files with 47 additions and 15 deletions

View file

@ -24,6 +24,19 @@ Ox.DocPage = function(options, self) {
self.$toolbar = Ox.Bar({size: 24});
self.$homeButton = Ox.Button({
title: 'home',
tooltip: 'Home',
type: 'image'
})
.css({float: 'left', margin: '4px 2px 4px 4px'})
.bindEvent({
click: function() {
that.triggerEvent('close');
}
})
.appendTo(self.$toolbar);
self.$title = Ox.Label({
style: 'square',
title: self.options.item.name
@ -34,7 +47,7 @@ Ox.DocPage = function(options, self) {
height: '13px',
paddingTop: '1px',
borderRadius: '4px',
margin: '4px'
margin: '4px 2px 4px 2px'
})
.appendTo(self.$toolbar)

View file

@ -329,11 +329,11 @@ Ox.DocPanel = function(options, self) {
replace: self.options.replace
})
.bindEvent({
close: function() {
selectItem();
},
example: function(data) {
that.triggerEvent('example', data);
},
select: function(data) {
selectItem(data.id);
}
});
that.$element.replaceElement(1, self.$page);

View file

@ -24,12 +24,25 @@ Ox.ExamplePage = function(options, self) {
self.$toolbar = Ox.Bar({size: 24});
self.$homeButton = Ox.Button({
title: 'home',
tooltip: 'Home',
type: 'image'
})
.css({float: 'left', margin: '4px 2px 4px 4px'})
.bindEvent({
click: function() {
that.triggerEvent('close');
}
})
.appendTo(self.$toolbar)
self.$title = Ox.Label({
style: 'square',
title: self.options.title
})
.css({float: 'left', borderRadius: '4px', margin: '4px'})
.appendTo(self.$toolbar)
.css({float: 'left', borderRadius: '4px', margin: '4px 2px 4px 2px'})
.appendTo(self.$toolbar);
self.$openButton = Ox.Button({
disabled: self.options.selected == 'source',

View file

@ -113,17 +113,23 @@ Ox.ExamplePanel = function(options, self) {
item = Ox.getObjectById(self.items, id);
self.$panel.replaceElement(1,
self.$page = Ox.ExamplePage({
height: window.innerHeight,
html: item.html,
js: item.js,
references: item.references,
replaceCode: self.options.replaceCode,
replaceComment: self.options.replaceComment,
title: item.title,
width: window.innerWidth - self.options.size
})
height: window.innerHeight,
html: item.html,
js: item.js,
references: item.references,
replaceCode: self.options.replaceCode,
replaceComment: self.options.replaceComment,
title: item.title,
width: window.innerWidth - self.options.size
})
.bindEvent({
close: function() {
selectItem();
}
})
);
} else {
self.$list.options({selected: []});
self.$page.empty().append(self.options.element);
}
self.options.selected = id;