fixes for DocPanel

This commit is contained in:
rolux 2011-05-07 19:52:33 +02:00
parent a58350a29e
commit f5f19c1c11
5 changed files with 18 additions and 15 deletions

View file

@ -4,7 +4,7 @@ Ox.load('UI', {
}, function() {
Ox.Theme('classic');
Ox.DocPanel({
files: ['Ox.js', 'Ox.UI/js/Map/Ox.Map.js'],
files: ['Ox.js', 'Ox.UI/js/Map/Ox.Map.js', 'Ox.UI/js/Core/Ox.Element.js', 'Ox.UI/js/Core/Ox.JQueryElement.js'],
getModule: function(item) {
var file = item.file.replace(Ox.PATH, '');
return file == 'Ox.js' ? 'Ox' : file.split('/')[0];

View file

@ -11,9 +11,12 @@ Ox.DocPage = function(options, self) {
overflow: 'auto'
});
Ox.print('-------------------item', self.options.item)
that.append($('<h1>').append('<code>' + self.options.item.name + '</code>'));
that.append($('<h1>')
.css({
marginTop: 0,
WebkitMarginBefore: 0
})
.append('<code>' + self.options.item.name + '</code>'));
getItem(self.options.item, 0).forEach(function($element) {
that.append($element);

View file

@ -75,11 +75,12 @@ Ox.DocPanel = function(options, self) {
docItem.section = self.options.getSection(docItem);
if (docItem.section) {
sectionIndex = Ox.getPositionById(
treeItems[moduleIndex].items, '_' + docItem.section
treeItems[moduleIndex].items,
'_' + docItem.module + '_' + docItem.section
);
if (sectionIndex == -1) {
treeItems[moduleIndex].items.push({
id: '_' + docItem.section,
id: '_' + docItem.module + '_' + docItem.section,
items: [],
title: docItem.section
});

View file

@ -10,11 +10,11 @@ Ox.JQueryElement <function> Wrapper for jQuery
Ox.JQueryElement = function($element) {
var that = this;
//@ Ox.JQueryElement.id <number> Unique id
//@ id <number> Unique id
that.id = Ox.uid();
//@ Ox.JQueryElement.ox <string> OxJS version
//@ ox <string> OxJS version
that.ox = Ox.VERSION;
//@ Ox.JQueryElement.$element <object> The jQuery DOM element
//@ $element <object> The jQuery DOM element
that.$element = $element.data({
oxid: that.id
});

View file

@ -76,11 +76,9 @@ Ox.uid = (function() {
/*@
Ox.wrap <f> Wraps a value so that one can directly call any Ox function on it
Additionally, chain() allows for chaining, and value() returns the
original value. See examples for details.
(value) -> <o> wrapped value
chain <f> wrap the return value to allow chaining
value <f> unwrap the value wrapped by chain()
value <f> unwrap the value wrapped by <code>chain()</chain>
value <*> Any value
> Ox.wrap("foobar").repeat(2)
"foobarfoobar"
@ -91,6 +89,7 @@ Ox.wrap <f> Wraps a value so that one can directly call any Ox function on it
@*/
Ox.wrap = function(val, chained) {
// somewhat inspired by underscore.js
var wrapper = {
chain: function() {
wrapper.chained = true;
@ -1348,11 +1347,11 @@ Ox.isLeapYear = function(year, utc) {
/*@
Ox.makeDate <f> Takes a date, number or string, returns a date
> Ox.formatDate(Ox.makeDate(new Date('01/01/1970')), '%M/%D/%Y')
> Ox.formatDate(Ox.makeDate(new Date('01/01/1970')), '%m/%d/%Y')
'01/01/1970'
> Ox.formatDate(Ox.makeDate(0), '%M/%D/%Y')
> Ox.formatDate(Ox.makeDate(0), '%m/%d/%Y')
'01/01/1970'
> Ox.formatDate(Ox.makeDate('01/01/1970'), '%M/%D/%Y')
> Ox.formatDate(Ox.makeDate('01/01/1970'), '%m/%d/%Y')
'01/01/1970'
@*/
Ox.makeDate = function(date) {