/* global OC */ $(document).ready(function () { var button; if ($('#body-login').length > 0) { return true; //deactivate on login page } function onFileListUpdated() { var hasImages = !!$("#fileList").find("tr[data-mime^='image']:first").length; button.toggleClass('hidden', !hasImages); } if ($('#filesApp').val() && $('#isPublic').val()) { $('#fileList').on('updated', onFileListUpdated); // toggle for opening shared file list as picture view // TODO find a way to not need to use inline CSS button = $('
'); button.click( function (event) { window.location.href = window.location.href.replace('service=files', 'service=gallery').replace('dir=', 'path='); }); $('#controls').append(button); } });