From 8d2ef17404c8248db3e7ac46a736eb0ff675a518 Mon Sep 17 00:00:00 2001 From: Valeriy Date: Thu, 23 Oct 2014 17:55:01 +0600 Subject: [PATCH] Added enterLikeTab option --- bower.json | 2 +- datetimepicker.jquery.json | 2 +- jquery.datetimepicker.js | 17 ++++++++++------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/bower.json b/bower.json index ab1315c..8cc9327 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name":"datetimepicker", - "version":"2.3.8", + "version":"2.3.9", "main": [ "jquery.datetimepicker.js", "jquery.datetimepicker.css" diff --git a/datetimepicker.jquery.json b/datetimepicker.jquery.json index c213c78..1bdd17d 100644 --- a/datetimepicker.jquery.json +++ b/datetimepicker.jquery.json @@ -1,6 +1,6 @@ { "name": "datetimepicker", - "version": "2.3.8", + "version": "2.3.9", "title": "jQuery Date and Time picker", "description": "jQuery plugin for date, time, or datetime manipulation in form", "keywords": [ diff --git a/jquery.datetimepicker.js b/jquery.datetimepicker.js index 68df804..9172e63 100644 --- a/jquery.datetimepicker.js +++ b/jquery.datetimepicker.js @@ -1,8 +1,9 @@ /** - * @preserve jQuery DateTimePicker plugin v2.3.8 + * @preserve jQuery DateTimePicker plugin v2.3.9 * @homepage http://xdsoft.net/jqplugins/datetimepicker/ * (c) 2014, Chupurnov Valeriy. */ +/*global document,window,jQuery,setTimeout,clearTimeout*/ (function ($) { 'use strict'; var default_options = { @@ -304,7 +305,9 @@ weekends: [], disabledDates : [], yearOffset: 0, - beforeShowDay: null + beforeShowDay: null, + + enterLikeTab: true }; // fix for ie8 if (!Array.prototype.indexOf) { @@ -623,11 +626,11 @@ if (_options.weekends && $.isArray(_options.weekends) && _options.weekends.length) { options.weekends = $.extend(true, [], _options.weekends); } - - if( _options.disabledDates && $.isArray(_options.disabledDates) && _options.disabledDates.length ){ - options.disabledDates = $.extend(true,[],_options.disabledDates); + + if (_options.disabledDates && $.isArray(_options.disabledDates) && _options.disabledDates.length) { + options.disabledDates = $.extend(true, [], _options.disabledDates); } - + if ((options.open || options.opened) && (!options.inline)) { input.trigger('open.xdsoft'); } @@ -1544,7 +1547,7 @@ .on('keydown.xdsoft', function (event) { var val = this.value, elementSelector, key = event.which; - if ([ENTER].indexOf(key) !== -1) { + if ([ENTER].indexOf(key) !== -1 && options.enterLikeTab) { elementSelector = $("input:visible,textarea:visible"); datetimepicker.trigger('close.xdsoft'); elementSelector.eq(elementSelector.index(this) + 1).focus();