Skip to content

Commit e762250

Browse files
authored
Update InfoPlan.php
1 parent 25b64a9 commit e762250

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

Block/Adminhtml/System/Config/Form/InfoPlan.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,22 @@ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $ele
5252
$script = '
5353
require(["jquery", "Magento_Ui/js/modal/alert", "domReady!"], function($, alert){
5454
setInterval(function(){
55-
var plusSection = $("#{$this->getSectionId()}-state").parent(".section-config");
56-
if (!plusSection.length) {
57-
plusSection = $("#{$this->getSectionId()}").parents("tr:first");
55+
var $section = $("#' . $this->getSectionId() . '-state").parent(".section-config");
56+
if (!$section.length) {
57+
$section = $("#' . $this->getSectionId() . '").parents("tr:first");
5858
}
59-
plusSection.find(".use-default").css("visibility", "hidden");
60-
plusSection.find("input,select").each(function(){
59+
60+
$section.find(".use-default").css("visibility", "hidden");
61+
$section.find("input,select").each(function(){
6162
$(this).attr("readonly", "readonly");
6263
$(this).removeAttr("disabled");
63-
if ($(this).data("gtmdisabled")) return;
64-
$(this).data("gtmdisabled", 1);
64+
if ($(this).data("mffdisabled")) return;
65+
$(this).data("mffdisabled", 1);
6566
$(this).click(function(){
67+
$(this).val($(this).data("mfOldValue"));
6668
alert({
6769
title: "You cannot use this option.",
68-
content: "{$optionAvailableInText}",
70+
content: "' . $optionAvailableInText . '",
6971
buttons: [{
7072
text: "Upgrade Plan Now",
7173
class: "action primary accept",
@@ -74,6 +76,8 @@ class: "action primary accept",
7476
}
7577
}]
7678
});
79+
}).on("focus", function() {
80+
$(this).data("mfOldValue", $(this).val());
7781
});
7882
});
7983
}, 1000);

0 commit comments

Comments
 (0)