Added default selectors for disable hub elements.

HFP-503
pull/38/head
thomasmars 2017-02-21 20:01:30 +01:00
parent c4affb23dd
commit 46d4d403f4
1 changed files with 6 additions and 4 deletions

View File

@ -21,8 +21,6 @@
*/ */
(function ($) { (function ($) {
$(document).on('ready', function () { $(document).on('ready', function () {
// No data found // No data found
@ -35,7 +33,11 @@
return; return;
} }
var selector = H5PDisableHubData.selector; H5PDisableHubData.selector = H5PDisableHubData.selector ||
'.h5p-settings-disable-hub-checkbox';
H5PDisableHubData.overlaySelector = H5PDisableHubData.overlaySelector ||
'.h5p-settings-container';
var dialogHtml = '<div>' + var dialogHtml = '<div>' +
'<p>' + H5PDisableHubData.errors.join('</p><p>') + '</p>' + '<p>' + H5PDisableHubData.errors.join('</p><p>') + '</p>' +
'<p>' + H5PDisableHubData.confirmationDialogMsg + '</p>'; '<p>' + H5PDisableHubData.confirmationDialogMsg + '</p>';
@ -56,7 +58,7 @@
disableButton.get(0).checked = true; disableButton.get(0).checked = true;
}); });
var disableButton = $(selector); var disableButton = $(H5PDisableHubData.selector);
disableButton.change(function () { disableButton.change(function () {
if (!$(this).is(':checked')) { if (!$(this).is(':checked')) {
confirmationDialog.show(disableButton.offset().top); confirmationDialog.show(disableButton.offset().top);