brianleroux/lawnchair — Issue #74: options.adapter - can not identify adapter
Author: Indiepath
Created: 2011-10-31 08:54:08+00:00
State: open

There is a problem with specifiying an adapter through the options - the code is flawed as it attempts to check the adapter name against adapter objects and not object vars.

Here is the fix :

// if the adapter is passed in we try to load that only
if (options.adapter) {
for (var i = 0, l = Lawnchair.adapters.length; i < l; i++) {
adapter = (Lawnchair.adapters[i].adapter === options.adapter && Lawnchair.adapters[i].valid()) ? Lawnchair.adapters[i] : undefined
if (adapter) break
}
// otherwise find the first valid adapter for this env
}
else {
for (var i = 0, l = Lawnchair.adapters.length; i < l; i++) {
adapter = Lawnchair.adapters[i].valid() ? Lawnchair.adapters[i] : undefined
if (adapter) break
}
}