Merge branch 'master' of github.com:easysoft/zentaopms
This commit is contained in:
@@ -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');
|
||||
}
|
||||
});
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -90,4 +90,4 @@ $(document).on('change', 'select', function()
|
||||
$(this).trigger("chosen:updated");
|
||||
$(this).trigger("change");
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -44,4 +44,5 @@ $(document).on('change', 'select', function()
|
||||
$(this).trigger("chosen:updated");
|
||||
$(this).trigger("change");
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@@ -75,4 +75,4 @@ $(document).on('change', 'select', function()
|
||||
$(this).trigger("chosen:updated");
|
||||
$(this).trigger("change");
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user