+ mergetacular
authorIan Gilman <iangilman@gmail.com>
Thu, 13 May 2010 15:14:46 -0700
changeset 49879 c0eea763394f85c62300186a95911d0acf0a0a7b
parent 49878 027686b05fe26175056e8886d0b39075d8a0510d (current diff)
parent 49875 55b902647dee622f00d507edfe08c0d26ba5164b (diff)
child 49880 ee43a7ccfafcc6dce239c72159ed3557fcb14a02
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
+ mergetacular
browser/base/content/tabcandy/app/ui.js
--- a/browser/base/content/tabcandy/app/groups.js
+++ b/browser/base/content/tabcandy/app/groups.js
@@ -968,23 +968,31 @@ var DragInfo = function(element, event) 
   
   this.$el.data('isDragging', true);
   this.item.setZ(99999);
 };
 
 DragInfo.prototype = {
   // ----------  
   snap: function(event, ui){
-    window.console.log( event, ui);
+    //window.console.log( event, ui);
     // Step 1: Find the closest group by edge
     
     // Step 2: Match to the to
     
   },
   
+  // ----------
+  start: function() {
+    // When a tab drag starts, make it the focused tab.
+    if( !this.item.isAGroup ){
+      Page.setActiveTab(this.item);
+    }    
+  },
+  
   // ----------  
   drag: function(event, ui) {
     if(this.item.isAGroup) {
       var bb = this.item.getBounds();
       bb.left = ui.position.left;
       bb.top = ui.position.top;
       this.item.setBounds(bb, true);
     } else
@@ -1018,16 +1026,17 @@ DragInfo.prototype = {
       
     if(this.item && !this.$el.hasClass('willGroup') && !this.item.parent) {
       this.item.setZ(drag.zIndex);
       drag.zIndex++;
       
       this.item.reloadBounds();
       this.item.pushAway();
     }
+    
   }
 };
 
 var drag = {
   info: null,
   zIndex: 100
 };
 
@@ -1036,16 +1045,17 @@ var drag = {
 // Singelton for managing all <Group>s. 
 window.Groups = {
   // ----------  
   dragOptions: {
     scroll: false,
     cancel: '.close',
     start: function(e, ui) {
       drag.info = new DragInfo(this, e);
+      drag.info.start();
     },
     drag: function(e, ui) {
       drag.info.drag(e, ui);
 
     },
     stop: function() {
       drag.info.stop();
       drag.info = null;
--- a/browser/base/content/tabcandy/app/ui.js
+++ b/browser/base/content/tabcandy/app/ui.js
@@ -213,18 +213,19 @@ window.Page = {
           }
           self.setActiveTab(nextTab);           
         }
         e.preventDefault();               
       }      
     });
     
     $(window).keyup(function(e){
-      // If you hit escape or return, zoom into the active tab.
-      if(e.which == 27 || e.which == 13)
+      // If you hit escape or return, zoom into the active tab,
+      // but only if a title or other element isn't focused.
+      if((e.which == 27 || e.which == 13) && $(":focus").length == 0 )
         if( self.getActiveTab() ) self.getActiveTab().zoom();
     });
   },
     
   // ----------  
   init: function() {
     var self = this;
     Utils.homeTab.raw.maxWidth = 60;
@@ -580,27 +581,27 @@ UIClass.prototype = {
 
     this.pageBounds = Items.getPageBounds();
   },
   
   // ----------
   addDevMenu: function() {
     var self = this;
     
-    var html = '<select style="position:absolute; top:5px;">'; 
+    var html = '<select style="position:absolute; bottom:5px; right:5px; opacity:.2;">'; 
     var $select = $(html)
       .appendTo('body')
       .change(function () {
         var index = $(this).val();
         commands[index].code();
         $(this).val(0);
       });
       
     var commands = [{
-      name: '*', 
+      name: 'dev menu', 
       code: function() {
       }
     }, {
       name: 'home', 
       code: function() {
         location.href = '../../index.html';
       }
     }, {
--- a/content/candies/revision-a/index.html
+++ b/content/candies/revision-a/index.html
@@ -34,12 +34,35 @@
   
   <!-- BEGIN Switch Control -->
   <script type="text/javascript;version=1.8" src="../../js/optional/switch.js"></script>  
   <!-- We create the actual switch in ui.js -->
   <!-- END Switch Control -->
 
   <script type="text/javascript;version=1.8" src="js/ui.js"></script>  
   <script type="text/javascript;version=1.8">
+  var uservoiceOptions = {
+    /* required */
+    key: 'mozillalabs',
+    host: 'feedback.mozillalabs.com', 
+    forum: '56804',
+    showTab: true,  
+    /* optional */
+    alignment: 'left',
+    background_color:'#E9E9E9', 
+    text_color: 'black',
+    hover_color: '#AAA',
+    lang: 'en',
+  };
+
+  function _loadUserVoice() {
+    var s = document.createElement('script');
+    s.setAttribute('type', 'text/javascript');
+    s.setAttribute('src', ("https:" == document.location.protocol ? "https://" : "http://") + "cdn.uservoice.com/javascripts/widgets/tab.js");
+    document.getElementsByTagName('head')[0].appendChild(s);
+  }
+  _loadSuper = window.onload;
+  window.onload = (typeof window.onload != 'function') ? _loadUserVoice : function() {    
+  _loadSuper(); _loadUserVoice(); };
   </script>
-
+  
 </body>
 </html>