Fixing feature configured icon malfunctioning issue on switch double-click

revert-dabc3590
dilanua 8 years ago
parent 2bc0d31af9
commit a2d9d4302c

@ -2793,20 +2793,28 @@ $(document).ready(function () {
// <start - fixing feature-configuring switch double-click issue> // <start - fixing feature-configuring switch double-click issue>
$(advanceOperations).on('hidden.bs.collapse', function (event) { $(advanceOperations).on('hidden.bs.collapse', function (event) {
var collapsedFeatureBody = event.target.id; var collapsedFeatureBody = event.target.id;
var featureConfiguringSwitch = "#" + collapsedFeatureBody. var operation = collapsedFeatureBody.substr(0, collapsedFeatureBody.lastIndexOf("-"));
substr(0, collapsedFeatureBody.lastIndexOf("-")) + "-heading input[type=checkbox]"; var featureConfiguringSwitch = "#" + operation + "-heading input[type=checkbox]";
var featureConfiguredIcon = "#" + operation + "-configured";
if ($(featureConfiguringSwitch).prop("checked") == true) { if ($(featureConfiguringSwitch).prop("checked") == true) {
$(featureConfiguringSwitch).prop("checked", false); $(featureConfiguringSwitch).prop("checked", false);
} }
if (!$(featureConfiguredIcon).hasClass("hidden")) {
$(featureConfiguredIcon).addClass("hidden");
}
}); });
$(advanceOperations).on('shown.bs.collapse', function (event) { $(advanceOperations).on('shown.bs.collapse', function (event) {
var expandedFeatureBody = event.target.id; var expandedFeatureBody = event.target.id;
var featureConfiguringSwitch = "#" + expandedFeatureBody. var operation = expandedFeatureBody.substr(0, expandedFeatureBody.lastIndexOf("-"));
substr(0, expandedFeatureBody.lastIndexOf("-")) + "-heading input[type=checkbox]"; var featureConfiguringSwitch = "#" + operation + "-heading input[type=checkbox]";
var featureConfiguredIcon = "#" + operation + "-configured";
if ($(featureConfiguringSwitch).prop("checked") == false) { if ($(featureConfiguringSwitch).prop("checked") == false) {
$(featureConfiguringSwitch).prop("checked", true); $(featureConfiguringSwitch).prop("checked", true);
} }
if ($(featureConfiguredIcon).hasClass("hidden")) {
$(featureConfiguredIcon).removeClass("hidden");
}
}); });
// <end - fixing feature-configuring switch double-click issue> // <end - fixing feature-configuring switch double-click issue>

@ -2556,20 +2556,28 @@ $(document).ready(function () {
// <start - fixing feature-configuring switch double-click issue> // <start - fixing feature-configuring switch double-click issue>
$(advanceOperations).on('hidden.bs.collapse', function (event) { $(advanceOperations).on('hidden.bs.collapse', function (event) {
var collapsedFeatureBody = event.target.id; var collapsedFeatureBody = event.target.id;
var featureConfiguringSwitch = "#" + collapsedFeatureBody. var operation = collapsedFeatureBody.substr(0, collapsedFeatureBody.lastIndexOf("-"));
substr(0, collapsedFeatureBody.lastIndexOf("-")) + "-heading input[type=checkbox]"; var featureConfiguringSwitch = "#" + operation + "-heading input[type=checkbox]";
var featureConfiguredIcon = "#" + operation + "-configured";
if ($(featureConfiguringSwitch).prop("checked") == true) { if ($(featureConfiguringSwitch).prop("checked") == true) {
$(featureConfiguringSwitch).prop("checked", false); $(featureConfiguringSwitch).prop("checked", false);
} }
if (!$(featureConfiguredIcon).hasClass("hidden")) {
$(featureConfiguredIcon).addClass("hidden");
}
}); });
$(advanceOperations).on('shown.bs.collapse', function (event) { $(advanceOperations).on('shown.bs.collapse', function (event) {
var expandedFeatureBody = event.target.id; var expandedFeatureBody = event.target.id;
var featureConfiguringSwitch = "#" + expandedFeatureBody. var operation = expandedFeatureBody.substr(0, expandedFeatureBody.lastIndexOf("-"));
substr(0, expandedFeatureBody.lastIndexOf("-")) + "-heading input[type=checkbox]"; var featureConfiguringSwitch = "#" + operation + "-heading input[type=checkbox]";
var featureConfiguredIcon = "#" + operation + "-configured";
if ($(featureConfiguringSwitch).prop("checked") == false) { if ($(featureConfiguringSwitch).prop("checked") == false) {
$(featureConfiguringSwitch).prop("checked", true); $(featureConfiguringSwitch).prop("checked", true);
} }
if ($(featureConfiguredIcon).hasClass("hidden")) {
$(featureConfiguredIcon).removeClass("hidden");
}
}); });
// <end - fixing feature-configuring switch double-click issue> // <end - fixing feature-configuring switch double-click issue>

Loading…
Cancel
Save