diff options
author | Piotr Dabrowski <p.dabrowski2@samsung.com> | 2013-07-31 12:45:17 +0200 |
---|---|---|
committer | Piotr Dabrowski <p.dabrowski2@samsung.com> | 2013-07-31 12:45:17 +0200 |
commit | 669827a66a472bd6cce6627721da06e935e57236 (patch) | |
tree | 690e18c54a907fe17562eb0f80f8c763bc4ef5ca | |
parent | 3795a9bbac1f952626c94294d9b008329bc1a092 (diff) | |
download | EventManager-669827a66a472bd6cce6627721da06e935e57236.tar.gz EventManager-669827a66a472bd6cce6627721da06e935e57236.tar.bz2 EventManager-669827a66a472bd6cce6627721da06e935e57236.zip |
[EventManager] updated EventManager sources
Change-Id: I54c157fc2ef340cef0962adf623e47b1d58d294f
-rw-r--r-- | js/app.ui.js | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/js/app.ui.js b/js/app.ui.js index 66e3ca1..1bc9daf 100644 --- a/js/app.ui.js +++ b/js/app.ui.js @@ -97,14 +97,17 @@ function Ui() { }); }); $(".customDuration, #customDuration").on("tap change", function (e) { - $("#yes_1").attr('checked', true).checkboxradio('refresh'); - $.each($('#new_alarm input:radio'), function () { - $(this).attr('checked', $(this).val() === 'Yes') - .checkboxradio('refresh'); - }); - $("#customDuration").removeClass('ui-disabled'); - $("#customDuration").prop('disabled', false); - $("#customDuration").trigger("focus"); + if ($(this).attr("checked")) { + $("#yes_1").attr('checked', true).checkboxradio('refresh'); + $.each($('#new_alarm input:radio'), function () { + $(this).attr('checked', $(this).val() === 'Yes') + .checkboxradio('refresh'); + }); + $("#customDuration") + .removeClass('ui-disabled') + .prop('disabled', false) + .trigger("focus"); + } }); document.addEventListener('webkitvisibilitychange', function (event) { @@ -122,7 +125,13 @@ function Ui() { } }); - $("input#customDuration").on("input keypress keyup", function (e) { + $("input#customDuration").on("keypress",function (e) { + if(/[^0-9]/.test(String.fromCharCode(e.keyCode))) { + e.preventDefault(); + e.stopPropagation(); + } + }); + $("input#customDuration").on("input keyup", function (e) { var val = parseInt($(this).val(), 10), max = parseInt($(this).attr("max"), 10), min = 0; |