MCPcopy Create free account
hub / github.com/PrairieLearn/PrairieLearn / addHandle

Function addHandle

public/localscripts/calculationQuestion/jquery.js:1215–1227  ·  view source on GitHub ↗

* Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied if the test fails * @param {Boolean} test The result of a test. If true, null will be set as the handler in leiu of the spec

( attrs, handler, test )

Source from the content-addressed store, hash-verified

1213 * @param {Boolean} test The result of a test. If true, null will be set as the handler in leiu of the specified handler
1214 */
1215function addHandle( attrs, handler, test ) {
1216 attrs = attrs.split("|");
1217 var current,
1218 i = attrs.length,
1219 setHandle = test ? null : handler;
1220
1221 while ( i-- ) {
1222 // Don't override a user's handler
1223 if ( !(current = Expr.attrHandle[ attrs[i] ]) || current === handler ) {
1224 Expr.attrHandle[ attrs[i] ] = setHandle;
1225 }
1226 }
1227}
1228
1229/**
1230 * Fetches boolean attributes by node

Callers 1

jquery.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected