Module:Infobox mapframe: Difference between revisions
Appearance
m 1 revision imported |
m 1 revision imported |
||
| (One intermediate revision by one other user not shown) | |||
| Line 81: | Line 81: | ||
function shouldAutoRun(frame) | function shouldAutoRun(frame) | ||
-- Check if should be running | -- Check if should be running | ||
local explicitlyOn = yesno(mw.text.trim( | local pargs = frame.getParent(frame).args | ||
local explicitlyOn = yesno(mw.text.trim(pargs.mapframe or "")) -- true of false or nil | |||
if pargs.coordinates == "{{{coordinates}}}" then explicitlyOn = false end | |||
local onByDefault = (explicitlyOn == nil) and yesno(mw.text.trim(frame.args.onByDefault or ""), false) -- true or false | local onByDefault = (explicitlyOn == nil) and yesno(mw.text.trim(frame.args.onByDefault or ""), false) -- true or false | ||
return explicitlyOn or onByDefault | return explicitlyOn or onByDefault | ||