diff --git a/source/Ox.UI/js/Code/DocPage.js b/source/Ox.UI/js/Code/DocPage.js index 8c106226..9b74f486 100644 --- a/source/Ox.UI/js/Code/DocPage.js +++ b/source/Ox.UI/js/Code/DocPage.js @@ -87,7 +87,7 @@ Ox.DocPage = function(options, self) { function getItem(item, level, name) { Ox.Log('Core', 'getItem', item, level, name); var $elements = [ - $('
') + Ox.$('
') .css({paddingLeft: (level ? level * 32 - 16 : 0) + 'px'}) .html( '' + (name || item.name) + ' ' @@ -124,7 +124,7 @@ Ox.DocPage = function(options, self) { isExpanded = !Ox.contains(section, 'inherited'); if (item[section]) { if (section == 'description') { - $elements.push($('
') + $elements.push(Ox.$('
') .css({ paddingTop: (level ? 0 : 8) + 'px', borderTopWidth: level ? 0 : '1px', @@ -134,7 +134,7 @@ Ox.DocPage = function(options, self) { .html(Ox.sanitizeHTML(item.description)) ); } else { - $elements.push($('
') + $elements.push(Ox.$('
') .css({ paddingTop: (level ? 0 : 8) + 'px', borderTopWidth: level ? 0 : '1px', @@ -142,7 +142,7 @@ Ox.DocPage = function(options, self) { marginLeft: (level * 32) + 'px' }) .append( - $('') + Ox.$('') .attr({ src: isExpanded ? Ox.UI.getImageURL('symbolDown') @@ -153,29 +153,31 @@ Ox.DocPage = function(options, self) { height: '12px', margin: '0 4px -1px 0' }) - .click(function() { - var $this = $(this), - isExpanded = $this.attr('src') == Ox.UI.getImageURL('symbolRight'); - $this.attr({ - src: isExpanded - ? Ox.UI.getImageURL('symbolDown') - : Ox.UI.getImageURL('symbolRight') - }); - $('.' + className).each(function() { - var $this = $(this), isHidden = false; - $this[isExpanded ? 'removeClass' : 'addClass'](className + 'Hidden'); - if (isExpanded) { - Ox.forEach(this.className.split(' '), function(v) { - if (/Hidden$/.test(v)) { - isHidden = true; - return false; // break - } - }); - !isHidden && $this.show(); - } else { - $this.hide(); - } - }); + .on({ + click: function() { + var $this = $(this), + isExpanded = $this.attr('src') == Ox.UI.getImageURL('symbolRight'); + $this.attr({ + src: isExpanded + ? Ox.UI.getImageURL('symbolDown') + : Ox.UI.getImageURL('symbolRight') + }); + $('.' + className).each(function() { + var $this = $(this), isHidden = false; + $this[isExpanded ? 'removeClass' : 'addClass'](className + 'Hidden'); + if (isExpanded) { + Ox.forEach(this.className.split(' '), function(v) { + if (/Hidden$/.test(v)) { + isHidden = true; + return false; // break + } + }); + !isHidden && $this.show(); + } else { + $this.hide(); + } + }); + } }) ) .append('' + ( @@ -190,7 +192,7 @@ Ox.DocPage = function(options, self) { item.tests.forEach(function(test) { var isAsync = test.expected && /(.+Ox\.test\()/.test(test.statement); $elements.push( - $('
') + Ox.$('
') .addClass(className) .css({marginLeft: (level * 32 + 16) + 'px'}) .html( @@ -211,7 +213,7 @@ Ox.DocPage = function(options, self) { ); if (test.expected) { $elements.push( - $('
') + Ox.$('
') .addClass(className) .css({marginLeft: (level * 32 + 16) + 'px'}) .html( @@ -234,7 +236,7 @@ Ox.DocPage = function(options, self) { }); } else if (section == 'source') { // fixme: not the right place to fix path - $elements.push($('
') + $elements.push(Ox.$('
') .addClass(className) .css({marginLeft: 16 + 'px'}) .html(