nextcloud / gallery

DEPRECATED Gallery app was replaced by Photos
https://github.com/nextcloud/photos
GNU Affero General Public License v3.0
109 stars 58 forks source link

Fix adding shares to wrong HTML element #370

Closed danxuliu closed 6 years ago

danxuliu commented 6 years ago

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 ;-)

MorrisJobke commented 6 years ago

Nice one - I guess that is the same what I noticed with #314 😉

MorrisJobke commented 6 years ago

Tested and backported to stable13 9fbc18d

MorrisJobke commented 6 years ago

Tested and backported to stable12 3aeda32

This will be in 12.0.5 and 13.0.0