Module:Tabs: Difference between revisions

Want an adless experience? Log in or Create an account.
I knew the logic was bad but not that bad. breaking it into two ifs for clarity
m (remove whitespace in content selection)
(I knew the logic was bad but not that bad. breaking it into two ifs for clarity)
 
(One intermediate revision by the same user not shown)
Line 91: Line 91:


   for _, c in ipairs( self.contents ) do
   for _, c in ipairs( self.contents ) do
     if self.tabsLeft and self.tabsLeft.defaultSelection == c.selection
     if type( c.selection ) == 'string'
      or self.tabsTop and self.tabsTop.defaultSelection == c.selection
        and (self.tabsLeft and self.tabsLeft.defaultSelection == c.selection:gsub( "%s", "" )
       or type( c.selection ) == 'table'
        or self.tabsTop and self.tabsTop.defaultSelection == c.selection:gsub( "%s", "" )) then
         and self.tabsLeft and self.tabsLeft.defaultSelection == c.selection.left
       c.default = true
         and self.tabsTop and self.tabsTop.defaultSelection == c.selection.top then
    elseif type( c.selection ) == 'table'
         and self.tabsLeft and self.tabsLeft.defaultSelection == c.selection.left:gsub( "%s", "" )
         and self.tabsTop and self.tabsTop.defaultSelection == c.selection.top:gsub( "%s", "" ) then
       c.default = true
       c.default = true
     end
     end