From 46d4d403f450c3033e1efd35eb79956f7478687b Mon Sep 17 00:00:00 2001 From: thomasmars Date: Tue, 21 Feb 2017 20:01:30 +0100 Subject: [PATCH] Added default selectors for disable hub elements. HFP-503 --- js/settings/h5p-disable-hub.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/js/settings/h5p-disable-hub.js b/js/settings/h5p-disable-hub.js index b525bd4..e78970a 100644 --- a/js/settings/h5p-disable-hub.js +++ b/js/settings/h5p-disable-hub.js @@ -21,8 +21,6 @@ */ (function ($) { - - $(document).on('ready', function () { // No data found @@ -35,7 +33,11 @@ return; } - var selector = H5PDisableHubData.selector; + H5PDisableHubData.selector = H5PDisableHubData.selector || + '.h5p-settings-disable-hub-checkbox'; + H5PDisableHubData.overlaySelector = H5PDisableHubData.overlaySelector || + '.h5p-settings-container'; + var dialogHtml = '
' + '

' + H5PDisableHubData.errors.join('

') + '

' + '

' + H5PDisableHubData.confirmationDialogMsg + '

'; @@ -56,7 +58,7 @@ disableButton.get(0).checked = true; }); - var disableButton = $(selector); + var disableButton = $(H5PDisableHubData.selector); disableButton.change(function () { if (!$(this).is(':checked')) { confirmationDialog.show(disableButton.offset().top);