Merge branch 'master' of github.com:easysoft/zentaopms

This commit is contained in:
wangyidong
2017-12-19 10:00:07 +08:00
8 changed files with 75 additions and 5 deletions
+12
View File
@@ -136,3 +136,15 @@ if(navigator.userAgent.indexOf("Firefox") < 0)
this.style.height = (this.scrollHeight + 2) + "px";
});
}
$(document).keydown(function(event)
{
if(event.keyCode == 38)
{
inputFocusJump('up');
}
else if(event.keyCode == 40)
{
inputFocusJump('down');
}
});
+13 -1
View File
@@ -33,7 +33,19 @@ $(document).on('mousedown', 'select', function()
}
$(this).val(value);
}
})
});
$(document).keydown(function(event)
{
if(event.keyCode == 38)
{
inputFocusJump('up');
}
else if(event.keyCode == 40)
{
inputFocusJump('down');
}
});
if(navigator.userAgent.indexOf("Firefox") < 0)
{
+1 -1
View File
@@ -90,4 +90,4 @@ $(document).on('change', 'select', function()
$(this).trigger("chosen:updated");
$(this).trigger("change");
}
})
});
+12 -1
View File
@@ -153,5 +153,16 @@ $(function()
if($.cookie('zeroTask') == 'true') toggleZeroTaskStory();
if(storyID != 0) setStoryRelated(0);
})
$(document).keydown(function(event)
{
if(event.keyCode == 38)
{
inputFocusJump('up');
}
else if(event.keyCode == 40)
{
inputFocusJump('down');
}
});
});
+2 -1
View File
@@ -44,4 +44,5 @@ $(document).on('change', 'select', function()
$(this).trigger("chosen:updated");
$(this).trigger("change");
}
})
});
+12
View File
@@ -57,6 +57,18 @@ $(document).ready(function()
$(this).val(value);
}
});
$(document).keydown(function(event)
{
if(event.keyCode == 38)
{
inputFocusJump('up');
}
else if(event.keyCode == 40)
{
inputFocusJump('down');
}
});
});
/**
+1 -1
View File
@@ -75,4 +75,4 @@ $(document).on('change', 'select', function()
$(this).trigger("chosen:updated");
$(this).trigger("change");
}
})
});
+22
View File
@@ -1941,6 +1941,28 @@ function revertModuleCookie()
}
}
/**
* Focus move up or down for input.
*
* @param type up|down
*/
function inputFocusJump(type){
var hasFocus = $('input').is(':focus');
if(hasFocus)
{
var title = $("input:focus").attr('name').replace(/\[\d]/g, '');
var $input = $(":input[name^=" + title + "]:text:not(:disabled):not([name*='%'])");
var num = $input.length;
var index = parseInt($("input:focus").attr('name').replace(/[^0-9]/g, ''));
var nextIndex = type == 'down' ? index + 1 : index - 1;
if(nextIndex < num && nextIndex >= 0)
{
$input[nextIndex].focus();
}
}
}
/* Ping the server every some minutes to keep the session. */
needPing = true;