Fixed for prompt popup does not working
authorbunam.jeon <bunam.jeon@samsung.com>
Fri, 18 Oct 2013 06:41:11 +0000 (15:41 +0900)
committerbunam.jeon <bunam.jeon@samsung.com>
Thu, 24 Oct 2013 10:18:09 +0000 (19:18 +0900)
[Title]    Fixed for prompt popup does not working
[Issue#]   N/A
[Problem]  Prompt popup does not working
[Cause]    Conformant element is duplicated.
[Solution] Remove the logic that generates the conformant element

Change-Id: Ibada116cbc8ba55795b75905163e9d0f228864c5

Source/WebKit2/UIProcess/API/efl/tizen/JavaScriptPopup.cpp
Source/WebKit2/UIProcess/API/efl/tizen/JavaScriptPopup.edc

index 7f89b22..5c8386d 100755 (executable)
@@ -127,6 +127,9 @@ bool JavaScriptPopup::alert(const char* message)
 {
     Evas_Object* parent = getParentWindow();
 
+    if (!parent)
+        return false;
+
     if (m_popup)
         return false;
 
@@ -189,6 +192,9 @@ bool JavaScriptPopup::confirm(const char* message)
 {
     Evas_Object* parent = getParentWindow();
 
+    if (!parent)
+        return false;
+
     if (m_popup)
         return false;
 
@@ -269,23 +275,15 @@ bool JavaScriptPopup::prompt(const char* message, const char* defaultValue)
 {
     Evas_Object* parent = getParentWindow();
 
-    if (m_popup)
-        return false;
-
     if (!parent)
         return false;
 
-    Evas_Object* conformant = elm_conformant_add(parent);
-    elm_win_conformant_set(parent, EINA_TRUE);
-    elm_win_resize_object_add(parent, conformant);
-    evas_object_size_hint_weight_set(conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-    evas_object_size_hint_align_set(conformant, EVAS_HINT_FILL, EVAS_HINT_FILL);
-    evas_object_show(conformant);
-
-    Evas_Object* content = elm_layout_add(conformant);
-    elm_object_content_set(conformant, content);
+    if (m_popup)
+        return false;
 
-    m_popup = elm_popup_add(content);
+    m_popup = elm_popup_add(parent);
+    if (!m_popup)
+        return false;
 
     if (message)
         elm_object_part_text_set(m_popup, "title,text", message);
@@ -397,23 +395,23 @@ Evas_Object* JavaScriptPopup::entry()
 Evas_Object* JavaScriptPopup::getParentWindow()
 {
     Evas_Object* parent = elm_object_parent_widget_get(m_ewkView);
-    Evas_Object* win = parent;
+    Evas_Object* content = parent;
 
     while (parent) {
         const char* type = elm_object_widget_type_get(parent);
         if (type) {
-            if (!strncmp(type, "elm_win", strlen("elm_win"))) {
-                win = parent;
+            if (!strncmp(type, "elm_conformant", strlen("elm_conformant"))) {
+                content = elm_object_content_get(parent);
                 break;
             }
         }
         parent = elm_object_parent_widget_get(parent);
     }
 
-    if (!win)
-        win = m_ewkView;
+    if (!content)
+        return 0;
 
-    return win;
+    return content;
 }
 
 void JavaScriptPopup::close()
index 28add93..bf9daca 100755 (executable)
@@ -35,14 +35,14 @@ collections {
                 scale : 1;
                 description {
                     state: "default" 0.0;
-                    min: 0 50;
+                    min: 0 70;
                     align: 0.5 0.5;
                     fixed: 1 0;
                     rel1 {
-                        relative: 0.0 0.0;
+                        offset : 30 30;
                     }
                     rel2 {
-                        relative: 1.0 1.0;
+                        offset : -30 -30;
                     }
                 }
             }