Skip to content
Snippets Groups Projects
Commit f67c6fe2 authored by xamgore's avatar xamgore
Browse files

Reuse of the same jQuery element

parent bc1e192b
Branches
Tags
No related merge requests found
......@@ -36,6 +36,8 @@ $(function () {
var g_submoduleTitle = "";
var g_submoduleMaxRate = 0;
var g_stdName = "";
var jCommonCell = $('.commonCell');
var jTdInfo_wrap = $("#tdInfo_wrap");
var jTdInfo = jTdInfo_wrap.children('#tdInfo');
var g_URL = (window.location.href).split("/");
......@@ -356,18 +358,18 @@ $(function () {
jThis.children("input").removeAttr("disabled");
}
$(".commonCell").mouseenter(function () {
jCommonCell.mouseenter(function () {
if (g_isFocusCell === false)
TdFocus($(this));
});
$(".commonCell").mouseleave(function () {
jCommonCell.mouseleave(function () {
if (g_isFocusCell === false)
TdUnFocus();
});
var oldRate = 0;
$(".commonCell").focusin(function () {
jCommonCell.focusin(function () {
g_isFocusCell = true;
TdFocus($(this));
TdInfo($(this));
......@@ -378,7 +380,7 @@ $(function () {
else oldRate = -1;
});
$(".commonCell").focusout(function () {
jCommonCell.focusout(function () {
g_isFocusCell = false;
Rating($(this), oldRate);
......@@ -437,7 +439,7 @@ $(function () {
return null;
}
$(".commonCell").keydown(function (e) {
jCommonCell.keydown(function (e) {
var row = g_row;
var col = g_col;
var direction;
......@@ -475,12 +477,12 @@ $(function () {
});
// При нажатии на элемент commonCell дочерный input получает фокус
$(".commonCell ").click(function () {
jCommonCell.click(function () {
$(this).children("input").focus();
});
// В inputCredit (где баллы вводить) разрешаем вводить только цифры
$(".commonCell").children("input").keydown(function (event) {
jCommonCell.children("input").keydown(function (event) {
KeyDownOnlyNumber(event);
});
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment