summaryrefslogtreecommitdiff
path: root/src/js
diff options
context:
space:
mode:
authorhjnim.kim <hjnim.kim@samsung.com>2013-04-15 16:13:44 +0900
committerYoumin Ha <youmin.ha@samsung.com>2013-04-16 13:34:17 +0900
commitb689d5931bf1bbfb43e6d4afb346eec2ac2786f7 (patch)
tree83c4aacaeea191ddda2b4028d95f5f05b03696a9 /src/js
parentdea2f13f91a7fb0b3de295126023c4021365e6eb (diff)
downloadweb-ui-fw-b689d5931bf1bbfb43e6d4afb346eec2ac2786f7.tar.gz
web-ui-fw-b689d5931bf1bbfb43e6d4afb346eec2ac2786f7.tar.bz2
web-ui-fw-b689d5931bf1bbfb43e6d4afb346eec2ac2786f7.zip
Timepicker: timepicker is closed when orientationchange event fired
timepicker is close when orientationchange event fired ( using global orientationchange event ) N_SE-34471 Change-Id: I1b33f41348ab773d23eae6253dcab15e8d891ec3
Diffstat (limited to 'src/js')
-rw-r--r--src/js/widgets/jquery.mobile.tizen.datetimepicker.js27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/js/widgets/jquery.mobile.tizen.datetimepicker.js b/src/js/widgets/jquery.mobile.tizen.datetimepicker.js
index 41b704d4..e4c9de72 100644
--- a/src/js/widgets/jquery.mobile.tizen.datetimepicker.js
+++ b/src/js/widgets/jquery.mobile.tizen.datetimepicker.js
@@ -135,6 +135,8 @@ define( [ 'jquery.mobile.tizen.widgetex', 'jquery.mobile.tizen.popupwindow', 'jq
initSelector: "input[type='date'], input[type='datetime'], input[type='time'], :jqmData(role='datetimepicker')"
},
+ container : null,
+
_calendar: function () {
return window.Globalize.culture().calendars.standard;
},
@@ -553,8 +555,30 @@ define( [ 'jquery.mobile.tizen.widgetex', 'jquery.mobile.tizen.popupwindow', 'jq
this.ui.bind('vclick', function ( e ) {
obj._showDataSelector( obj, this, e.target );
});
- },
+ $.extend( this, {
+ _globalHandlers: [
+ {
+ src: $( window ),
+ handler: {
+ orientationchange: $.proxy( this, "_orientationHandler" )
+ }
+ }
+ ]
+ });
+
+ $.each( this._globalHandlers, function( idx, value ) {
+ value.src.bind( value.handler );
+ });
+ },
+ _orientationHandler: function() {
+ var self = this;
+ if( self._popup_open ) {
+ self._popup_open = false;
+ self.container.popupwindow( 'close' );
+ }
+ return false;
+ },
_populateDataSelector: function ( field, pat ) {
var values,
numItems,
@@ -731,6 +755,7 @@ define( [ 'jquery.mobile.tizen.widgetex', 'jquery.mobile.tizen.popupwindow', 'jq
target.offset().left + ( target.width() / 2 ) + newLeft - window.pageXOffset ,
target.offset().top + target.height() - window.pageYOffset );
+ this.container = $ctx;
this._popup_open = true;
$div.bind('popupafterclose', function ( e ) {