ソースを参照

Position the cursor at the after last matched position when the END-key is pressed.

Robin Herbots 15 年 前
コミット
820c0691fd
1 ファイル変更7 行追加2 行削除
  1. 7 2
      jquery.inputmask.js

+ 7 - 2
jquery.inputmask.js

@@ -3,7 +3,7 @@ Input Mask plugin for jquery
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 0.2.8b
+Version: 0.2.9
  
 This plugin is based on the masked input plugin written by Josh Bush (digitalbush.com)
 */
@@ -566,7 +566,12 @@ This plugin is based on the masked input plugin written by Josh Bush (digitalbus
                         else shiftL(pos.begin + (k == opts.keyCode.DELETE || pos.begin < pos.end ? 0 : -1), maskL);
                     }
                     return false;
-                } else if (k == opts.keyCode.ESCAPE) {//escape
+                } else if (k == opts.keyCode.END) { //when END pressed set position at lastmatch
+                    setTimeout(function() {
+                        caret(input, checkVal(input, buffer, false));
+                    }, 0);
+                }
+                else if (k == opts.keyCode.ESCAPE) {//escape
                     _val.call(input, undoBuffer);
                     caret(input, 0, checkVal(input, buffer));
                     return false;