Skip to content

Commit

Permalink
Standards fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
billtomczak committed Jun 14, 2022
1 parent 680a857 commit 15ae190
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/media/js/jquery.osdownloads.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@
* along with OSDownloads. If not, see <http://www.gnu.org/licenses/>.
*/

;(function osdownloadsClosure($) {
;jQuery(function($) {
$.fn.osdownloads = function osdownloads(options) {
if (this.length) {
return this.each(function osdownloadsEachElement() {
return this.each(function() {
if ($(this).data('osdownloads-loaded') === 1) {
return;
}

let $this = $(this),
prefix = $this.data('prefix'),
animation = $this.data('animation'),
popupElementId = prefix + '_popup',
$popup = $('#' + popupElementId),
$btnContinue = $popup.find('.osdownloads-continue-button'),
$form = $popup.find('form');
let $this = $(this),
prefix = $this.data('prefix'),
animation = $this.data('animation'),
popupElementId = prefix + '_popup',
$popup = $('#' + popupElementId),
$btnContinue = $popup.find('.osdownloads-continue-button'),
$form = $popup.find('form');

if ($popup.length !== 1 && $form.length !== 1) {
return;
Expand Down Expand Up @@ -74,18 +74,18 @@

// Close the requirements popup
$container.on('reveal:close', function() {
setTimeout(function timeoutRemoveIframePopup() {
setTimeout(function() {
$container.remove();
}, 500);
});
$popup.trigger('reveal:close');

setTimeout(function timeoutShowPopup() {
setTimeout(function() {
showPopup('#' + prefix + 'PopupIframe');
}, 500);
};

$this.on('click', function downloadBtnOnClick(event) {
$this.on('click', function(event) {
event.preventDefault();
event.stopPropagation();

Expand All @@ -101,7 +101,7 @@
);

$btnContinue.off();
$btnContinue.on('click', function continueBtnOnClick(event) {
$btnContinue.on('click', function(event) {
event.preventDefault();

if ($form.valid()) {
Expand All @@ -114,5 +114,5 @@
});
}
};
})(jQuery);
});

0 comments on commit 15ae190

Please sign in to comment.