Skip to content

Instantly share code, notes, and snippets.

@denisz
Created October 12, 2018 07:59
Show Gist options
  • Save denisz/9615eb2d37a4e2dcb3db7dfed221fe30 to your computer and use it in GitHub Desktop.
Save denisz/9615eb2d37a4e2dcb3db7dfed221fe30 to your computer and use it in GitHub Desktop.
$(".unreal-form-call").on("click", function() {
var t = $(this)
, e = t.data("period") ? t.data("period") : null
, i = ["Unreal", "Epic"]
, n = t.data("type");
d.then(function(t) {
var s = t.find("#orderUnrealForm")
, r = s.find("#packages")
, o = s.find("#period")
, a = s.find("#period option")
, l = {
Basic: 0,
Standart: 1,
Optimal: 1,
Expert: 1,
Unreal: 2,
Epic: 2
}[n];
r.val(n),
i.includes(n) && a.each(function(t) {
t < 2 && $(this).hide()
}),
null !== e ? o.val(e) : o.val(l)
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment