aboutsummaryrefslogtreecommitdiffstats
path: root/admin/themes
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2015-02-13 08:46:19 +0000
committermistic100 <mistic@piwigo.org>2015-02-13 08:46:19 +0000
commit9df2050888494b23e0b4ccddd91d240012ca7721 (patch)
tree58a13c925e5b34398dd36bc3c5065bbf634b6a63 /admin/themes
parentf5979a419e3d328ca5a5d6ee4c56feb5dab143cf (diff)
Merged revision(s) 30958 from trunk:
bug 3190: Datetime picker, can't change year on Chrome & IE11 git-svn-id: http://piwigo.org/svn/branches/2.7@30959 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/themes')
-rw-r--r--admin/themes/default/js/datepicker.js44
1 files changed, 0 insertions, 44 deletions
diff --git a/admin/themes/default/js/datepicker.js b/admin/themes/default/js/datepicker.js
index cabf1f479..a550e197b 100644
--- a/admin/themes/default/js/datepicker.js
+++ b/admin/themes/default/js/datepicker.js
@@ -30,16 +30,12 @@ $.datepicker._selectMonthYear = debounce(function(id, select, period) {
inst['drawYear'] = '';
}
else {
- var pos = getCursor($('.ui-datepicker-year')[0]);
-
inst['selectedYear'] = inst['drawYear'] = val;
this._notifyChange(inst);
this._adjustDate(target);
$('.ui-datepicker-year').focus();
-
- setCursor($('.ui-datepicker-year')[0], pos);
}
}
}, 500);
@@ -170,46 +166,6 @@ jQuery.fn.pwgDatepicker = function(settings) {
});
};
-
-// functions for custom year input
-function setCursor(node,pos){
- var node = (typeof node == "string" || node instanceof String) ? document.getElementById(node) : node;
-
- if (!node) {
- return false;
- }
- else if(node.createTextRange) {
- var textRange = node.createTextRange();
- textRange.collapse(true);
- textRange.moveEnd(pos);
- textRange.moveStart(pos);
- textRange.select();
- return true;
- }
- else if(node.setSelectionRange) {
- node.setSelectionRange(pos,pos);
- return true;
- }
-
- return false;
-}
-
-function getCursor(input) {
- // Internet Explorer Caret Position (TextArea)
- if (document.selection && document.selection.createRange) {
- var range = document.selection.createRange();
- var bookmark = range.getBookmark();
- return bookmark.charCodeAt(2) - 2;
- }
- else {
- // Firefox Caret Position (TextArea)
- if (input.setSelectionRange)
- return input.selectionStart;
- }
-
- return 0;
-}
-
function debounce(func, wait, immediate) {
var timeout;
return function() {