Loading lib/jsduck/exporter.rb +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ module JsDuck def compact_member(m) m_copy = {} [:name, :tagname, :owner, :protected, :static, :deprecated, :required].each do |key| [:name, :tagname, :owner, :protected, :static, :deprecated, :required, :template].each do |key| m_copy[key] = m[key] end m_copy Loading lib/jsduck/merger.rb +3 −3 Original line number Diff line number Diff line Loading @@ -166,7 +166,7 @@ module JsDuck :owner => detect_owner(doc_map) || owner, :type => detect_type(:cfg, doc_map, code), :doc => detect_doc(docs), :optional => detect_optional(:cfg, doc_map), :required => detect_required(:cfg, doc_map), :default => detect_default(:cfg, doc_map, code), :properties => detect_subproperties(docs, :cfg), :accessor => !!doc_map[:accessor], Loading Loading @@ -294,9 +294,9 @@ module JsDuck return explicit_name == "" || explicit_name == implicit_name end def detect_optional(tagname, doc_map) def detect_required(tagname, doc_map) main_tag = doc_map[tagname] ? doc_map[tagname].first : {} return main_tag[:optional] != false return main_tag[:optional] == false end # for detecting mixins and alternateClassNames Loading lib/jsduck/renderer.rb +1 −1 Original line number Diff line number Diff line Loading @@ -225,7 +225,7 @@ module JsDuck if m[:deprecated] after += "<strong class='deprecated-signature'>deprecated</strong>" end if m[:tagname] == :cfg && !m[:optional] if m[:required] after += "<strong class='required-signature'>required</strong>" end if m[:template] Loading spec/aggregator_default_values_spec.rb +4 −4 Original line number Diff line number Diff line Loading @@ -360,8 +360,8 @@ describe JsDuck::Aggregator do */ EOS end it "is optional by default" do @doc[:optional].should == true it "is not required by default" do @doc[:required].should == false end end Loading @@ -373,8 +373,8 @@ describe JsDuck::Aggregator do */ EOS end it "has optional flag set to false" do @doc[:optional].should == false it "has required flag set to true" do @doc[:required].should == true end end Loading template/app/view/HoverMenu.js +6 −5 Original line number Diff line number Diff line Loading @@ -46,11 +46,12 @@ Ext.define('Docs.view.HoverMenu', { columnHeight: this.columnHeight, showCloseButtons: this.showCloseButtons, renderLink: function(values) { var url = values.url || values.cls, label = values.label || values.cls, stat = values['static'] ? '<span class="static">static</span>' : "", prot = values['protected'] ? '<span class="protected">protected</span>' : ""; return Ext.String.format('<a href="#!/api/{0}" rel="{0}" class="docClass">{1} {2} {3}</a>', url, label, stat, prot); var url = values.url || values.cls; var label = values.label || values.cls; var tags = Ext.Array.map(['static', 'protected', 'deprecated', 'template', 'required'], function(tag) { return values[tag] ? '<span class="'+tag+'">'+tag+'</span>' : ''; }).join(' '); return Ext.String.format('<a href="#!/api/{0}" rel="{0}" class="docClass">{1} {2}</a>', url, label, tags); } } ); Loading Loading
lib/jsduck/exporter.rb +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ module JsDuck def compact_member(m) m_copy = {} [:name, :tagname, :owner, :protected, :static, :deprecated, :required].each do |key| [:name, :tagname, :owner, :protected, :static, :deprecated, :required, :template].each do |key| m_copy[key] = m[key] end m_copy Loading
lib/jsduck/merger.rb +3 −3 Original line number Diff line number Diff line Loading @@ -166,7 +166,7 @@ module JsDuck :owner => detect_owner(doc_map) || owner, :type => detect_type(:cfg, doc_map, code), :doc => detect_doc(docs), :optional => detect_optional(:cfg, doc_map), :required => detect_required(:cfg, doc_map), :default => detect_default(:cfg, doc_map, code), :properties => detect_subproperties(docs, :cfg), :accessor => !!doc_map[:accessor], Loading Loading @@ -294,9 +294,9 @@ module JsDuck return explicit_name == "" || explicit_name == implicit_name end def detect_optional(tagname, doc_map) def detect_required(tagname, doc_map) main_tag = doc_map[tagname] ? doc_map[tagname].first : {} return main_tag[:optional] != false return main_tag[:optional] == false end # for detecting mixins and alternateClassNames Loading
lib/jsduck/renderer.rb +1 −1 Original line number Diff line number Diff line Loading @@ -225,7 +225,7 @@ module JsDuck if m[:deprecated] after += "<strong class='deprecated-signature'>deprecated</strong>" end if m[:tagname] == :cfg && !m[:optional] if m[:required] after += "<strong class='required-signature'>required</strong>" end if m[:template] Loading
spec/aggregator_default_values_spec.rb +4 −4 Original line number Diff line number Diff line Loading @@ -360,8 +360,8 @@ describe JsDuck::Aggregator do */ EOS end it "is optional by default" do @doc[:optional].should == true it "is not required by default" do @doc[:required].should == false end end Loading @@ -373,8 +373,8 @@ describe JsDuck::Aggregator do */ EOS end it "has optional flag set to false" do @doc[:optional].should == false it "has required flag set to true" do @doc[:required].should == true end end Loading
template/app/view/HoverMenu.js +6 −5 Original line number Diff line number Diff line Loading @@ -46,11 +46,12 @@ Ext.define('Docs.view.HoverMenu', { columnHeight: this.columnHeight, showCloseButtons: this.showCloseButtons, renderLink: function(values) { var url = values.url || values.cls, label = values.label || values.cls, stat = values['static'] ? '<span class="static">static</span>' : "", prot = values['protected'] ? '<span class="protected">protected</span>' : ""; return Ext.String.format('<a href="#!/api/{0}" rel="{0}" class="docClass">{1} {2} {3}</a>', url, label, stat, prot); var url = values.url || values.cls; var label = values.label || values.cls; var tags = Ext.Array.map(['static', 'protected', 'deprecated', 'template', 'required'], function(tag) { return values[tag] ? '<span class="'+tag+'">'+tag+'</span>' : ''; }).join(' '); return Ext.String.format('<a href="#!/api/{0}" rel="{0}" class="docClass">{1} {2}</a>', url, label, tags); } } ); Loading