egardner added a comment.

  The widgets in the WikibaseMediaInfo extension use templates and `render()` 
methods to ensure that the visible UI remains in sync with the structured data 
as it changes. Existing DOM elements are often thrown out and re-rendered from 
scratch to ensure consistency. Our introduction of this workflow into the 
Captions widget is probably what initially broke this gadget.
  
  Because the DOM elements are not guaranteed to be persistent here, I'd say 
that an approach that leans more on CSS overrides is going to be a better bet 
in the long run. JS can and will continue to change.
  
  This selector will target the individual captions inside the panel: 
`.wbmi-entityview-captionsPanel .wbmi-entityview-captions` (you need an extra 
level of specificity because of some OOUI rules). If the gadget was able to 
add/remove a class at the top level of `.wbmi-tabs-container` (the 
higheset-level DOM element the MediaInfo extension touches), you could override 
the existing styles with `display:none` or anything else you wanted. Then you 
could simply toggle the class on that top-level element (there are no 
`render()` calls happening there that would interfere).
  
    .my-toggled-gadget-class .wbmi-entityview-captionsPanel 
.wbmi-entityview-captions {
        display: none;
    }
  
  Hope this helps.

TASK DETAIL
  https://phabricator.wikimedia.org/T235811

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: egardner
Cc: egardner, Mike_Peel, Jdforrester-WMF, Abit, Masumrezarock100, zhuyifei1999, 
Jmabel, Aklapper, JKSTNK, Lahi, PDrouin-WMF, E1presidente, Ramsey-WMF, Cparle, 
Anooprao, SandraF_WMF, Tramullas, Acer, Salgo60, Silverfish, Poyekhali, 
Taiwania_Justo, Susannaanas, Ixocactus, Wong128hk, Jane023, Wikidata-bugs, 
Base, matthiasmullie, El_Grafo, Dinoguy1000, Ricordisamoa, Wesalius, 
Lydia_Pintscher, Fabrice_Florin, Raymond, Steinsplitter, Keegan
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to