(input)
| 14216 | |
| 14217 | // Flatten the group selector into an array of single options |
| 14218 | var process = function (input) { |
| 14219 | if (Array.isArray(input)) { |
| 14220 | for (var i = 0, ien = input.length; i < ien; i++) { |
| 14221 | process(input[i]) |
| 14222 | } |
| 14223 | return |
| 14224 | } |
| 14225 | |
| 14226 | if (typeof input === "string") { |
| 14227 | if (input.indexOf(",") !== -1) { |
| 14228 | // String selector, list of names |
| 14229 | process(input.split(",")) |
| 14230 | } else { |
| 14231 | // String selector individual name |
| 14232 | var idx = $.inArray(input.trim(), names) |
| 14233 | |
| 14234 | if (idx !== -1) { |
| 14235 | ret.push(buttons[idx].inst) |
| 14236 | } |
| 14237 | } |
| 14238 | } else if (typeof input === "number") { |
| 14239 | // Index selector |
| 14240 | ret.push(buttons[input].inst) |
| 14241 | } else if (typeof input === "object" && input.nodeName) { |
| 14242 | // Element selector |
| 14243 | for (var j = 0; j < buttons.length; j++) { |
| 14244 | if (buttons[j].inst.dom.container[0] === input) { |
| 14245 | ret.push(buttons[j].inst) |
| 14246 | } |
| 14247 | } |
| 14248 | } else if (typeof input === "object") { |
| 14249 | // Actual instance selector |
| 14250 | ret.push(input) |
| 14251 | } |
| 14252 | } |
| 14253 | |
| 14254 | process(group) |
| 14255 |
no test coverage detected