@@ -1081,11 +1081,11 @@ function program1(depth0,data) {
1081
1081
if ( stack1 = helpers . id ) { stack1 = stack1 . call ( depth0 , { hash :{ } , data :data } ) ; }
1082
1082
else { stack1 = depth0 . id ; stack1 = typeof stack1 === functionType ? stack1 . apply ( depth0 ) : stack1 ; }
1083
1083
buffer += escapeExpression ( stack1 )
1084
- + "' onclick =\"Docs.toggleEndpointListForResource(' " ;
1084
+ + "' class =\"toggleEndpointList\" data-id=\" " ;
1085
1085
if ( stack1 = helpers . id ) { stack1 = stack1 . call ( depth0 , { hash :{ } , data :data } ) ; }
1086
1086
else { stack1 = depth0 . id ; stack1 = typeof stack1 === functionType ? stack1 . apply ( depth0 ) : stack1 ; }
1087
1087
buffer += escapeExpression ( stack1 )
1088
- + "'); \">" ;
1088
+ + "\">" ;
1089
1089
if ( stack1 = helpers . name ) { stack1 = stack1 . call ( depth0 , { hash :{ } , data :data } ) ; }
1090
1090
else { stack1 = depth0 . name ; stack1 = typeof stack1 === functionType ? stack1 . apply ( depth0 ) : stack1 ; }
1091
1091
buffer += escapeExpression ( stack1 )
@@ -1106,19 +1106,19 @@ function program1(depth0,data) {
1106
1106
if ( stack1 = helpers . id ) { stack1 = stack1 . call ( depth0 , { hash :{ } , data :data } ) ; }
1107
1107
else { stack1 = depth0 . id ; stack1 = typeof stack1 === functionType ? stack1 . apply ( depth0 ) : stack1 ; }
1108
1108
buffer += escapeExpression ( stack1 )
1109
- + "'\n onclick =\"Docs.toggleEndpointListForResource(' " ;
1109
+ + "' class=\"toggleEndpointList\" data-id =\"" ;
1110
1110
if ( stack1 = helpers . id ) { stack1 = stack1 . call ( depth0 , { hash :{ } , data :data } ) ; }
1111
1111
else { stack1 = depth0 . id ; stack1 = typeof stack1 === functionType ? stack1 . apply ( depth0 ) : stack1 ; }
1112
1112
buffer += escapeExpression ( stack1 )
1113
- + "'); \">Show/Hide</a>\n </li>\n <li>\n <a href='#' onclick =\"Docs.collapseOperationsForResource(' " ;
1113
+ + "\">Show/Hide</a>\n </li>\n <li>\n <a href='#' class =\"collapseResource\" data-id=\" " ;
1114
1114
if ( stack1 = helpers . id ) { stack1 = stack1 . call ( depth0 , { hash :{ } , data :data } ) ; }
1115
1115
else { stack1 = depth0 . id ; stack1 = typeof stack1 === functionType ? stack1 . apply ( depth0 ) : stack1 ; }
1116
1116
buffer += escapeExpression ( stack1 )
1117
- + "'); return false; \">\n List Operations\n </a>\n </li>\n <li>\n <a href='#' onclick =\"Docs.expandOperationsForResource(' " ;
1117
+ + "\">\n List Operations\n </a>\n </li>\n <li>\n <a href='#' class =\"expandResource\" data-id= " ;
1118
1118
if ( stack1 = helpers . id ) { stack1 = stack1 . call ( depth0 , { hash :{ } , data :data } ) ; }
1119
1119
else { stack1 = depth0 . id ; stack1 = typeof stack1 === functionType ? stack1 . apply ( depth0 ) : stack1 ; }
1120
1120
buffer += escapeExpression ( stack1 )
1121
- + "'); return false;\" >\n Expand Operations\n </a>\n </li>\n <li>\n <a href='" ;
1121
+ + ">\n Expand Operations\n </a>\n </li>\n <li>\n <a href='" ;
1122
1122
if ( stack1 = helpers . url ) { stack1 = stack1 . call ( depth0 , { hash :{ } , data :data } ) ; }
1123
1123
else { stack1 = depth0 . url ; stack1 = typeof stack1 === functionType ? stack1 . apply ( depth0 ) : stack1 ; }
1124
1124
buffer += escapeExpression ( stack1 )
@@ -1537,6 +1537,9 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
1537
1537
operation . parentId = this . model . id ;
1538
1538
this . addOperation ( operation ) ;
1539
1539
}
1540
+ $ ( '.toggleEndpointList' , this . el ) . click ( this . callDocs . bind ( this , 'toggleEndpointListForResource' ) ) ;
1541
+ $ ( '.collapseResource' , this . el ) . click ( this . callDocs . bind ( this , 'collapseOperationsForResource' ) ) ;
1542
+ $ ( '.expandResource' , this . el ) . click ( this . callDocs . bind ( this , 'expandOperationsForResoruce' ) ) ;
1540
1543
return this ;
1541
1544
} ;
1542
1545
@@ -1553,6 +1556,11 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
1553
1556
return this . number ++ ;
1554
1557
} ;
1555
1558
1559
+ ResourceView . prototype . callDocs = function ( fnName , e ) {
1560
+ e . preventDefault ( ) ;
1561
+ return Docs [ fnName ] ( e . currentTarget . getAttribute ( 'data-id' ) ) ;
1562
+ } ;
1563
+
1556
1564
return ResourceView ;
1557
1565
1558
1566
} ) ( Backbone . View ) ;
0 commit comments