diff options
author | Piotr Dabrowski <p.dabrowski2@samsung.com> | 2013-07-15 14:35:49 +0200 |
---|---|---|
committer | Piotr Dabrowski <p.dabrowski2@samsung.com> | 2013-07-15 14:35:49 +0200 |
commit | e902cf5e7a4c0fcbc0948b95a13b66a1a0088987 (patch) | |
tree | 3d37cc13a0cfa36f12cf4880d3cb8e7736b4ae93 | |
parent | f8e11bc7ef3e64f51d16a257e2f65ed0b444beb7 (diff) | |
download | EventManager-e902cf5e7a4c0fcbc0948b95a13b66a1a0088987.tar.gz EventManager-e902cf5e7a4c0fcbc0948b95a13b66a1a0088987.tar.bz2 EventManager-e902cf5e7a4c0fcbc0948b95a13b66a1a0088987.zip |
[EventManager] updated EventManager sources
Change-Id: I463660dffb76e6e1574a35886c987b274c36e0c4
-rw-r--r-- | js/app.ui.js | 22 | ||||
-rw-r--r-- | templates/alarm.tpl | 2 |
2 files changed, 17 insertions, 7 deletions
diff --git a/js/app.ui.js b/js/app.ui.js index 30ba86b..c86b55a 100644 --- a/js/app.ui.js +++ b/js/app.ui.js @@ -65,6 +65,8 @@ function Ui() { app.ui.new_event.updateDateFormat(); app.ui.new_event.setStartDate(); app.ui.new_event.setEndDate(); + $("#demo-date-1").datetimepicker("value", new Date()); + $("#demo-date-2").datetimepicker("value", new Date()); $('#add-event-btn').removeClass('disabled'); // workaround for N_SE-43733 $(".ui-datefield-selected").removeClass('ui-datefield-selected'); @@ -77,14 +79,24 @@ function Ui() { } $('input[type=radio]').change( function () { - $("#customDuration").blur(); if ($(this).val() === 'Yes') { $("#customDuration").removeClass('ui-disabled'); + $("#customDuration").focus(); } else { + $("#customDuration").blur(); $("#customDuration").addClass('ui-disabled'); } }); }); + $(".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").trigger("focus"); + }); document.addEventListener('webkitvisibilitychange', function (event) { $(".ui-popup").popup('close'); @@ -101,7 +113,7 @@ function Ui() { } }); - $("input.customDuration").on("input keypress keyup", function (e) { + $("input#customDuration").on("input keypress keyup", function (e) { var val = parseInt($(this).val(), 10), max = parseInt($(this).attr("max"), 10), min = 0; @@ -121,8 +133,6 @@ function Ui() { if ($.mobile.activePage.attr('id') === 'home') { tizen.application.getCurrentApplication().exit(); } else if ($.mobile.activePage.attr('id') === 'new_event') { - $("#demo-date-1").datetimepicker("value", new Date); - $("#demo-date-2").datetimepicker("value", new Date); $.mobile.changePage("#home"); } else { history.back(); @@ -457,7 +467,7 @@ function Ui() { */ alarm: { init: function UI_alarm_init() { - $("#customDuration").val(0); + $("#customDuration").val(""); }, setValue: function (duration) { if(typeof duration == "undefined") { @@ -482,7 +492,7 @@ function Ui() { { value = parseInt($("#customDuration").val(), 10); }else{ - $("#customDuration").val(0).addClass('ui-disabled'); + $("#customDuration").val("").addClass('ui-disabled'); } return value; }, diff --git a/templates/alarm.tpl b/templates/alarm.tpl index 975ea9f..c253a32 100644 --- a/templates/alarm.tpl +++ b/templates/alarm.tpl @@ -23,7 +23,7 @@ <input type="radio" class="customDuration" name="radio-choice" id="yes_1" value="Yes" > - <input placeholder="00" class="customDuration" type="number" name="radio-choice" value="0" min="0" max="99" id="customDuration"/> + <input placeholder="00" class="customDuration" type="number" name="radio-choice" min="0" max="99" id="customDuration"/> <label class="customDuration" for="customDuration">minute(s) before</label> </div><!-- /content --> |