Commit b751b5ee authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Use icons mixin in class doc section titles.

All sections now have class members-section instead of type-specific
id-s.  This also simplifies the code to loop over all sections.

Comments are now in separate comments-section.
parent faa3b257
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -136,9 +136,9 @@ module JsDuck
        statics = @cls[:statics][sec[:type]]
        if members.length > 0 || statics.length > 0
          [
            "<div id='m-#{sec[:type]}'>",
            "<div class='members-section'>",
              statics.length == 0 ? "<div class='definedBy'>Defined By</div>" : "",
              "<h3 class='members-title'>#{sec[:title]}</h3>",
              "<h3 class='members-title icon-#{sec[:type]}'>#{sec[:title]}</h3>",
              render_subsection(members, statics.length > 0 ? "Instance #{sec[:title]}" : nil),
              render_subsection(statics, "Static #{sec[:title]}"),
            "</div>",
+4 −4
Original line number Diff line number Diff line
@@ -31,8 +31,8 @@ Ext.define('Docs.view.Comments', {
        );

        this.classCommentsTpl = Ext.create('Ext.XTemplate',
            '<div id="m-comment">',
                '<h3 class="members-title">Comments</h3>',
            '<div class="comments-section">',
                '<h3 class="members-title icon-comment">Comments</h3>',
                commentsMeta.join(''),
            '</div>'
        );
@@ -307,7 +307,7 @@ Ext.define('Docs.view.Comments', {
            Ext.getCmp('classCommentToolbarBtn').update(clsMeta['']);

            // Update class level comments meta
            this.numCommentsTpl.overwrite(Ext.get(Ext.query('#m-comment a.name')[0]), {
            this.numCommentsTpl.overwrite(Ext.get(Ext.query('.comments-section a.name')[0]), {
                num: clsMeta['']
            });
        } else {
@@ -315,7 +315,7 @@ Ext.define('Docs.view.Comments', {
            Ext.getCmp('classCommentToolbarBtn').update('0');

            // Update class level comments meta
            this.numCommentsTpl.overwrite(Ext.get(Ext.query('#m-comment a.name')[0]), {
            this.numCommentsTpl.overwrite(Ext.get(Ext.query('.comments-section a.name')[0]), {
                num: 0
            });
        }
+4 −7
Original line number Diff line number Diff line
@@ -126,16 +126,13 @@ Ext.define('Docs.view.cls.Overview', {
            Ext.get(m).removeCls('first-child');
        });

        Ext.Array.forEach(['cfg', 'property', 'method', 'event', 'css_var', 'css_mixin'], function(type) {
            var sectionId = '#m-' + type;

        Ext.Array.forEach(Ext.query('.members-section'), function(section) {
            // Hide the section completely if all items in it are hidden
            var visibleEls = this.getVisibleElements(sectionId + " .member");
            var section = Ext.query(sectionId)[0];
            section && Ext.get(section).setStyle({display: visibleEls.length > 0 ? 'block' : 'none'});
            var visibleEls = this.getVisibleElements(".member", section);
            Ext.get(section).setStyle({display: visibleEls.length > 0 ? 'block' : 'none'});

            // Hide subsections completely if all items in them are hidden
            Ext.Array.forEach(Ext.query(sectionId+" .subsection"), function(subsection) {
            Ext.Array.forEach(Ext.query(".subsection", section), function(subsection) {
                var visibleEls = this.getVisibleElements(".member", subsection);
                if (visibleEls.length > 0) {
                    // add first-child class to first member in subsection
+10 −21
Original line number Diff line number Diff line
@@ -83,29 +83,18 @@
    padding-top: 0; }
  h3.pa {
    padding: 10px 0 5px 0; }
  .members-section, .comments-section {
    margin-bottom: 40px; }
    h3.members-title {
      margin: 20px 0 5px 0;
    padding: 0 0 0 30px;
      padding: 0 0 0 25px;
      font-size: 1.3em;
      font-weight: bold; }
  #m-cfg,
  #m-property,
  #m-method,
  #m-event,
  #m-comment {
    margin-bottom: 40px; }
  #m-cfg .members-title {
    background: url(../images/configs.png) no-repeat 0 -1px; }
  #m-property .members-title {
      background: url(../images/properties.png) no-repeat 0 4px; }
  #m-method .members-title {
    background: url(../images/methods.png) no-repeat 0 2px; }
  #m-event .members-title {
    background: url(../images/events.png) no-repeat 0 -2px; }
  #m-comment .members-title {
    @include icons;
    .icon-comment {
      background: url(../images/icons.png) no-repeat 1px -490px; }
  h4.members-subtitle {
    padding-left: 30px;
    padding-left: 25px;
    margin: 10px 0 7px 0; }
  ul ul {
    list-style: circle;
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
  font-weight: bold;
  cursor: pointer; }

#m-comment {
.comments-section {
  .comments {
    @include member-expander; } }
#commentindex {