Module:Message box: Difference between revisions

change the smalltext logic to work with collapsible text fields
m>Mr. Stradivarius
(bug fix: isSmall --> self.isSmall)
m>Mr. Stradivarius
(change the smalltext logic to work with collapsible text fields)
Line 216: Line 216:


         -- Get the self.issue value.
         -- Get the self.issue value.
         local sect = args.sect
         if self.isSmall and args.smalltext then
        if presentButBlank(sect) then
             self.issue = args.smalltext
             sect = 'This ' .. (cfg.sectionDefault or 'page')
        elseif type(sect) == 'string' then
            sect = 'This ' .. sect
         else
         else
             sect = nil
             local sect = args.sect
            if presentButBlank(sect) then
                sect = 'This ' .. (cfg.sectionDefault or 'page')
            elseif type(sect) == 'string' then
                sect = 'This ' .. sect
            else
                sect = nil
            end
            local issue = args.issue
            issue = type(issue) == 'string' and issue or nil
            local text = args.text
            text = type(text) == 'string' and text or nil
            local issues = {}
            tinsert(issues, sect)
            tinsert(issues, issue)
            tinsert(issues, text)
            self.issue = tconcat(issues, ' ')
         end
         end
        local issue = args.issue
        issue = type(issue) == 'string' and issue or nil
        local text = args.text
        text = type(text) == 'string' and text or nil
        local issues = {}
        tinsert(issues, sect)
        tinsert(issues, issue)
        tinsert(issues, text)
        self.issue = tconcat(issues, ' ')


         -- Get the self.talk value.
         -- Get the self.talk value.
Line 274: Line 278:
     -- and also by ambox when small=yes.
     -- and also by ambox when small=yes.
     if self.isSmall then
     if self.isSmall then
         if self.useCollapsibleTextFields then
         self.text = args.smalltext or args.text
            self.text = args.smalltext or self.issue
        else
            self.text = args.smalltext or args.text
        end
     else
     else
         self.text = args.text
         self.text = args.text
Anonymous user