_addShareWith adds a share to the #shareWithList element, which is a descendant of the share dropdown. However, the Sharing tab of the Files app sidebar contains its own #shareWithList element, so when the share dropdown is shown on top of the Files app (by clicking on an image
and then sharing it from the slideshow) and the Sharing tab is open in the sidebar the share element ends added to the wrong element. To prevent this the matched element is now limited to descendants of the share dropdown.
Fixes (in master) #300
_addShareWith
adds a share to the#shareWithList
element, which is a descendant of the share dropdown. However, the Sharing tab of the Files app sidebar contains its own#shareWithList
element, so when the share dropdown is shown on top of the Files app (by clicking on an image and then sharing it from the slideshow) and the Sharing tab is open in the sidebar the share element ends added to the wrong element. To prevent this the matched element is now limited to descendants of the share dropdown.Note, however, that there should not be two elements with the same ID in the same page. A better solution would have been to ensure that, but as the sharing code seems to be going to be eventually removed from the gallery and replaced with a sidebar component from the server it was not worth to spend time on that ;-)