Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 494a044

Browse files
committed
Merge branch 'master' into dev
2 parents 2b55aba + fc1115e commit 494a044

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@ jQuery Tools is a collection of the most important user-interface components for
66
##Contributing
77

88
Please issue pull requests to the [dev branch](https://github.com/jquerytools/jquerytools/tree/dev).
9-
This is where active development takes place, we then merge changes into master for releases
9+
10+
This is where active development takes place, we then merge changes into master for releases. That will become v1.2.6.
11+
Most of the development goes to 2.0 which is currently a private repository.
12+

src/dateinput/dateinput.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,10 @@
282282
currMonth = date.getMonth();
283283
currDay = date.getDate();
284284

285+
// focus the input after selection (doesn't work in IE)
286+
if (e.type == "click" && !$.browser.msie) {
287+
input.focus();
288+
}
285289

286290
// beforeChange
287291
e = e || $.Event("api");
@@ -317,13 +321,13 @@
317321
if (e.ctrlKey) { return true; }
318322
var key = e.keyCode;
319323

320-
// backspace clears the value
321-
if (key == 8) {
324+
// backspace or delete clears the value
325+
if (key == 8 || key == 46) {
322326
input.val("");
323327
return self.hide(e);
324328
}
325329

326-
// esc or tab key
330+
// esc or tab key exits
327331
if (key == 27 || key == 9) { return self.hide(e); }
328332

329333
if ($(KEYS).index(key) >= 0) {
@@ -664,11 +668,11 @@
664668
e.type = "onHide";
665669
fire.trigger(e);
666670

667-
$(document).unbind("click.d").unbind("keydown.d");
668-
669671
// cancelled ?
670672
if (e.isDefaultPrevented()) { return; }
671673

674+
$(document).unbind("click.d").unbind("keydown.d");
675+
672676
// do the hide
673677
root.hide();
674678
opened = false;
@@ -729,6 +733,10 @@
729733
if (!opened && $(KEYS).index(key) >= 0) {
730734
self.show(e);
731735
return e.preventDefault();
736+
737+
// clear value on backspace or delete
738+
} else if (key == 8 || key == 46) {
739+
input.val("");
732740
}
733741

734742
// allow tab

0 commit comments

Comments
 (0)