Contextpopup: context popup reposition module has been added
authorhjnim.kim <hjnim.kim@samsung.com>
Wed, 24 Apr 2013 09:57:52 +0000 (18:57 +0900)
committerYoumin Ha <youmin.ha@samsung.com>
Fri, 26 Apr 2013 05:43:30 +0000 (14:43 +0900)
Context popup reposition module has been added
( If browser resize event fired, context popup reposition after popup show )
DCM-1469

Change-Id: Ib56093f3e6df767d9ca45538497dc092424fda40

libs/patch/0020-JQM-Apply-tizen-style-context-popup.patch

index c467f7b..00ed2bd 100644 (file)
@@ -1,18 +1,18 @@
-From 3a3b8ea37dbe26879cac7861e4478856bcf91d6e Mon Sep 17 00:00:00 2001
+From d96db7f8a2ab691ca92492ac3b0c253afea40250 Mon Sep 17 00:00:00 2001
 From: "hjnim.kim" <hjnim.kim@samsung.com>
-Date: Wed, 10 Apr 2013 13:22:06 +0900
-Subject: [PATCH] JQM Applied tizen style popup, context popup
+Date: Thu, 25 Apr 2013 12:38:27 +0900
+Subject: [PATCH] JQM Apply Tizen style context popup and window popup
 
-Apply tizen style popup, context popup
+Apply tizen style and operation
 
-Change-Id: I757bdf622e4ee106aa3ace5ab6665633879b740f
+Change-Id: I73884fd8bd78e4704b1d6357d1c2a10bc6609a4f
 Signed-off-by: hyunjung kim <hjnim.kim@samsung.com>
 ---
- libs/js/jquery-mobile-1.2.0/js/widgets/popup.js |  113 +++++++++++++++++++++--
- 1 files changed, 103 insertions(+), 10 deletions(-)
+ libs/js/jquery-mobile-1.2.0/js/widgets/popup.js |  129 +++++++++++++++++++++--
+ 1 files changed, 119 insertions(+), 10 deletions(-)
 
 diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js b/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js
-index 8174055..203599d 100644
+index 8174055..c4d6a22 100644
 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js
 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/popup.js
 @@ -58,7 +58,7 @@ define( [ "jquery",
@@ -138,7 +138,44 @@ index 8174055..203599d 100644
                },
  
                _createPrereqs: function( screenPrereq, containerPrereq, whenDone ) {
-@@ -569,7 +622,7 @@ define( [ "jquery",
+@@ -461,6 +514,8 @@ define( [ "jquery",
+               _desiredCoords: function( x, y, positionTo ) {
+                       var dst = null, offset, winCoords = windowCoords();
++                      self.positionTo = positionTo;
++
+                       // Establish which element will serve as the reference
+                       if ( positionTo && positionTo !== "origin" ) {
+                               if ( positionTo === "window" ) {
+@@ -499,6 +554,19 @@ define( [ "jquery",
+                       return { x: x, y: y };
+               },
++              _reposition: function() {
++                      var self = this,
++                                      coords;
++
++                      if( self._isOpen
++                              && self.link
++                              && self.positionTo !== "window") {
++                                      coords = self._placementCoords( self._desiredCoords( $(self.link).offset().left + $(self.link).outerWidth() /2 , $(self.link).offset().top + $(self.link).outerHeight() /2 , self.positionTo || self.options.positionTo || "origin" ) );
++                                      self._ui.container
++                                              .offset( { top : coords.top } );
++                      }
++              },
++
+               _openPrereqsComplete: function() {
+                       var self = this;
+@@ -512,6 +580,7 @@ define( [ "jquery",
+                       setTimeout(function(){
+                               self._ui.container.attr( "tabindex", "0" ).focus();
+                               self._trigger( "afteropen" );
++                              self._reposition();
+                       });
+               },
+@@ -569,7 +638,7 @@ define( [ "jquery",
                        this._ui.container
                                .removeClass( "ui-selectmenu-hidden" )
                                .offset( coords );
@@ -147,7 +184,7 @@ index 8174055..203599d 100644
                        if ( this.options.overlayTheme && androidBlacklist ) {
                                /* TODO:
                                The native browser on Android 4.0.X ("Ice Cream Sandwich") suffers from an issue where the popup overlay appears to be z-indexed
-@@ -694,15 +747,55 @@ define( [ "jquery",
+@@ -694,15 +763,55 @@ define( [ "jquery",
                // what should be in _open. Seems to be "visual" vs "history" for now
                open: function( options ) {
                        var self = this, opts = this.options, url, hashkey, activePage, currentIsDialog, hasHash, urlHistory;
@@ -163,7 +200,7 @@ index 8174055..203599d 100644
 +                      if( !options ) {
 +                              options = [];
 +                      }
++
 +                      if ( !options.link ) {
 +                              if ( !event ) {
 +                                      self.positionTo = "window";
@@ -176,7 +213,7 @@ index 8174055..203599d 100644
 +                      if ( event ) {
 +                              self.positionTo = ( options != null && options.positionTo != null ) ? options.positionTo : "origin";
 +                      }
-+
 +                      if ( $(self.link).jqmData("position-to") !== "window"
 +                                      && self.positionTo !== "window" ) {
 +