Always close event editor when open Calendar Widget
authorEduardo Becerra <eduardo.becerra@openbravo.com>
Mon, 23 May 2016 13:58:02 +0200
changeset 29642 55a1c4875c47
parent 29641 f345a264432d
child 29643 91083519cb27
Always close event editor when open Calendar Widget
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-calendar-widget.js
--- a/modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-calendar-widget.js	Tue May 17 18:18:12 2016 +0200
+++ b/modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-calendar-widget.js	Mon May 23 13:58:02 2016 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2013 Openbravo SLU
+ * All portions are Copyright (C) 2013-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -69,10 +69,17 @@
   },
 
   refresh: function () {
+    var widget = null;
     if (this.members[1]) {
-      this.members[1].members[0].members[0].initComponents();
+      widget = this.members[1].members[0].members[0];
     } else if (this.members[0]) {
-      this.members[0].members[0].members[0].initComponents();
+      widget = this.members[0].members[0].members[0];
+    }
+    if (widget) {
+      if (widget.calendar.currentEventEditor) {
+        widget.calendar.currentEventEditor.hide();
+      }
+      widget.initComponents();
     }
   },