File tree Expand file tree Collapse file tree
assets/javascripts/resources Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -162,6 +162,26 @@ QueryBuilder = {
162162 } ,
163163 get_subclasses_for_selected_class : function ( ) {
164164 QueryBuilder . properties . get_subclasses ( QueryBuilder . classes . get_selected_class ( ) ) ;
165+ } ,
166+ select_subclass : function ( uri ) {
167+
168+ $ ( "#property_main_subclasses_group" ) . find ( ".list-group-item" ) . each ( function ( index ) {
169+ var html = "" ;
170+ if ( $ ( this ) . attr ( "uri" ) == uri ) {
171+ if ( $ ( this ) . attr ( "clicked" ) == "true" ) {
172+ $ ( this ) . attr ( "clicked" , "false" ) ;
173+ } else {
174+ html += "<span class='glyphicon glyphicon-ok'></span> " ;
175+ $ ( this ) . attr ( "clicked" , "true" ) ;
176+ }
177+ if ( uri == "all" )
178+ html += "<strong>"
179+ html += $ ( this ) . attr ( "display-name" ) ;
180+ if ( uri == "all" )
181+ html += "</strong>" ;
182+ $ ( this ) . html ( html ) ;
183+ }
184+ } ) ;
165185 }
166186 }
167187
Original file line number Diff line number Diff line change 8989 </ div >
9090 </ div >
9191 < div class ="list-group " id ="property_main_subclasses_group " subclasses ="all ">
92- < a class ="list-group-item property-subclass-group " href ="javascript:void(0) "> < strong > All</ strong > </ a >
92+ < a class ="list-group-item property-subclass-group " href ="javascript:void(0) " onclick =" QueryBuilder.properties.select_subclass('all') " uri =" all " clicked =' true ' display-name =" All " > < span class =" glyphicon glyphicon-ok " > </ span > < strong > All</ strong > </ a >
9393 </ div >
9494 < div class ="row " id ="qb_properties_sub_classes_loading " style ="display:none; ">
9595 < div class ="col-md-12 ">
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ $("#property_main_subclass_header").find("button").first().hide("fast");
33
44 var list_group = $ ( "#property_main_subclasses_group" ) . find ( ".list-group-item" ) . first ( ) ;
55< % @subclasses . each do | sc | % >
6- var html = "<a href='javascript:void(0);' class='property-subclass-individual list-group-item' uri='<%=sc[:uri]%>'><%=sc[:name].capitalize%></a>" ;
6+ var html = "<a href='javascript:void(0);' class='property-subclass-individual list-group-item' uri='<%=sc[:uri]%>' display-name='<%=sc[:name]%>' ><%=sc[:name].capitalize%></a>" ;
77 $ ( list_group ) . after ( html ) ;
88< % end % >
99
You can’t perform that action at this time.
0 commit comments