Bug 1112565 - Close the Loop panel when opening the getting started tour. rs=dolske a=dolske
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Wed, 17 Dec 2014 23:43:33 -0500
changeset 242530 18c371fb51cb9a48a38068a6c181d228a2a81279
parent 242529 32dd6121c2059fa3e8d3915f0fb6b0d84bafdd54
child 242531 be7097c9f0609f168194c6bba7cc2d58b79cd8c3
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdolske, dolske
bugs1112565
milestone36.0a2
Bug 1112565 - Close the Loop panel when opening the getting started tour. rs=dolske a=dolske
browser/components/loop/content/js/panel.js
browser/components/loop/content/js/panel.jsx
--- a/browser/components/loop/content/js/panel.js
+++ b/browser/components/loop/content/js/panel.js
@@ -161,21 +161,24 @@ loop.panel = (function(_, mozL10n) {
             )
           )
         )
       );
     }
   });
 
   var GettingStartedView = React.createClass({displayName: 'GettingStartedView',
+    mixins: [sharedMixins.WindowCloseMixin],
+
     handleButtonClick: function() {
       navigator.mozLoop.openGettingStartedTour("getting-started");
       navigator.mozLoop.setLoopPref("gettingStarted.seen", true);
       var event = new CustomEvent("GettingStartedSeen");
       window.dispatchEvent(event);
+      this.closeWindow();
     },
 
     render: function() {
       if (navigator.mozLoop.getLoopPref("gettingStarted.seen")) {
         return null;
       }
       return (
         React.DOM.div({id: "fte-getstarted"}, 
@@ -264,17 +267,17 @@ loop.panel = (function(_, mozL10n) {
       );
     }
   });
 
   /**
    * Panel settings (gear) menu.
    */
   var SettingsDropdown = React.createClass({displayName: 'SettingsDropdown',
-    mixins: [sharedMixins.DropdownMenuMixin],
+    mixins: [sharedMixins.DropdownMenuMixin, sharedMixins.WindowCloseMixin],
 
     handleClickSettingsEntry: function() {
       // XXX to be implemented at the same time as unhiding the entry
     },
 
     handleClickAccountEntry: function() {
       navigator.mozLoop.openFxASettings();
     },
@@ -295,16 +298,17 @@ loop.panel = (function(_, mozL10n) {
     },
 
     _isSignedIn: function() {
       return !!navigator.mozLoop.userProfile;
     },
 
     openGettingStartedTour: function() {
       navigator.mozLoop.openGettingStartedTour("settings-menu");
+      this.closeWindow();
     },
 
     render: function() {
       var cx = React.addons.classSet;
 
       // For now all of the menu entries require FxA so hide the whole gear if FxA is disabled.
       if (!navigator.mozLoop.fxAEnabled) {
         return null;
--- a/browser/components/loop/content/js/panel.jsx
+++ b/browser/components/loop/content/js/panel.jsx
@@ -161,21 +161,24 @@ loop.panel = (function(_, mozL10n) {
             </li>
           </ul>
         </div>
       );
     }
   });
 
   var GettingStartedView = React.createClass({
+    mixins: [sharedMixins.WindowCloseMixin],
+
     handleButtonClick: function() {
       navigator.mozLoop.openGettingStartedTour("getting-started");
       navigator.mozLoop.setLoopPref("gettingStarted.seen", true);
       var event = new CustomEvent("GettingStartedSeen");
       window.dispatchEvent(event);
+      this.closeWindow();
     },
 
     render: function() {
       if (navigator.mozLoop.getLoopPref("gettingStarted.seen")) {
         return null;
       }
       return (
         <div id="fte-getstarted">
@@ -264,17 +267,17 @@ loop.panel = (function(_, mozL10n) {
       );
     }
   });
 
   /**
    * Panel settings (gear) menu.
    */
   var SettingsDropdown = React.createClass({
-    mixins: [sharedMixins.DropdownMenuMixin],
+    mixins: [sharedMixins.DropdownMenuMixin, sharedMixins.WindowCloseMixin],
 
     handleClickSettingsEntry: function() {
       // XXX to be implemented at the same time as unhiding the entry
     },
 
     handleClickAccountEntry: function() {
       navigator.mozLoop.openFxASettings();
     },
@@ -295,16 +298,17 @@ loop.panel = (function(_, mozL10n) {
     },
 
     _isSignedIn: function() {
       return !!navigator.mozLoop.userProfile;
     },
 
     openGettingStartedTour: function() {
       navigator.mozLoop.openGettingStartedTour("settings-menu");
+      this.closeWindow();
     },
 
     render: function() {
       var cx = React.addons.classSet;
 
       // For now all of the menu entries require FxA so hide the whole gear if FxA is disabled.
       if (!navigator.mozLoop.fxAEnabled) {
         return null;