fixes for DocPanel
This commit is contained in:
parent
a58350a29e
commit
f5f19c1c11
5 changed files with 18 additions and 15 deletions
|
@ -4,7 +4,7 @@ Ox.load('UI', {
|
||||||
}, function() {
|
}, function() {
|
||||||
Ox.Theme('classic');
|
Ox.Theme('classic');
|
||||||
Ox.DocPanel({
|
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) {
|
getModule: function(item) {
|
||||||
var file = item.file.replace(Ox.PATH, '');
|
var file = item.file.replace(Ox.PATH, '');
|
||||||
return file == 'Ox.js' ? 'Ox' : file.split('/')[0];
|
return file == 'Ox.js' ? 'Ox' : file.split('/')[0];
|
||||||
|
|
|
@ -11,9 +11,12 @@ Ox.DocPage = function(options, self) {
|
||||||
overflow: 'auto'
|
overflow: 'auto'
|
||||||
});
|
});
|
||||||
|
|
||||||
Ox.print('-------------------item', self.options.item)
|
that.append($('<h1>')
|
||||||
|
.css({
|
||||||
that.append($('<h1>').append('<code>' + self.options.item.name + '</code>'));
|
marginTop: 0,
|
||||||
|
WebkitMarginBefore: 0
|
||||||
|
})
|
||||||
|
.append('<code>' + self.options.item.name + '</code>'));
|
||||||
|
|
||||||
getItem(self.options.item, 0).forEach(function($element) {
|
getItem(self.options.item, 0).forEach(function($element) {
|
||||||
that.append($element);
|
that.append($element);
|
||||||
|
|
|
@ -75,11 +75,12 @@ Ox.DocPanel = function(options, self) {
|
||||||
docItem.section = self.options.getSection(docItem);
|
docItem.section = self.options.getSection(docItem);
|
||||||
if (docItem.section) {
|
if (docItem.section) {
|
||||||
sectionIndex = Ox.getPositionById(
|
sectionIndex = Ox.getPositionById(
|
||||||
treeItems[moduleIndex].items, '_' + docItem.section
|
treeItems[moduleIndex].items,
|
||||||
|
'_' + docItem.module + '_' + docItem.section
|
||||||
);
|
);
|
||||||
if (sectionIndex == -1) {
|
if (sectionIndex == -1) {
|
||||||
treeItems[moduleIndex].items.push({
|
treeItems[moduleIndex].items.push({
|
||||||
id: '_' + docItem.section,
|
id: '_' + docItem.module + '_' + docItem.section,
|
||||||
items: [],
|
items: [],
|
||||||
title: docItem.section
|
title: docItem.section
|
||||||
});
|
});
|
||||||
|
|
|
@ -10,11 +10,11 @@ Ox.JQueryElement <function> Wrapper for jQuery
|
||||||
|
|
||||||
Ox.JQueryElement = function($element) {
|
Ox.JQueryElement = function($element) {
|
||||||
var that = this;
|
var that = this;
|
||||||
//@ Ox.JQueryElement.id <number> Unique id
|
//@ id <number> Unique id
|
||||||
that.id = Ox.uid();
|
that.id = Ox.uid();
|
||||||
//@ Ox.JQueryElement.ox <string> OxJS version
|
//@ ox <string> OxJS version
|
||||||
that.ox = Ox.VERSION;
|
that.ox = Ox.VERSION;
|
||||||
//@ Ox.JQueryElement.$element <object> The jQuery DOM element
|
//@ $element <object> The jQuery DOM element
|
||||||
that.$element = $element.data({
|
that.$element = $element.data({
|
||||||
oxid: that.id
|
oxid: that.id
|
||||||
});
|
});
|
||||||
|
|
11
source/Ox.js
11
source/Ox.js
|
@ -76,11 +76,9 @@ Ox.uid = (function() {
|
||||||
|
|
||||||
/*@
|
/*@
|
||||||
Ox.wrap <f> Wraps a value so that one can directly call any Ox function on it
|
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
|
(value) -> <o> wrapped value
|
||||||
chain <f> wrap the return value to allow chaining
|
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
|
value <*> Any value
|
||||||
> Ox.wrap("foobar").repeat(2)
|
> Ox.wrap("foobar").repeat(2)
|
||||||
"foobarfoobar"
|
"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) {
|
Ox.wrap = function(val, chained) {
|
||||||
|
// somewhat inspired by underscore.js
|
||||||
var wrapper = {
|
var wrapper = {
|
||||||
chain: function() {
|
chain: function() {
|
||||||
wrapper.chained = true;
|
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.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'
|
'01/01/1970'
|
||||||
> Ox.formatDate(Ox.makeDate(0), '%M/%D/%Y')
|
> Ox.formatDate(Ox.makeDate(0), '%m/%d/%Y')
|
||||||
'01/01/1970'
|
'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'
|
'01/01/1970'
|
||||||
@*/
|
@*/
|
||||||
Ox.makeDate = function(date) {
|
Ox.makeDate = function(date) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue