sync
[roojs1] / roojs-bootstrap-debug.js
index 86cf32b..6bb9cd0 100644 (file)
@@ -362,6 +362,11 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent,  {
     {
         return this.el;
     },
+    getDocumentBody : function() // used by menus - as they are attached to the body so zIndexes work
+    {
+        return Roo.get(document.body);
+    },
+    
     /**
      * Fetch the element to display the tooltip on.
      * @return {Roo.Element} defaults to this.el
@@ -2888,8 +2893,8 @@ Roo.bootstrap.ButtonUploader = function(config){
          /**
          * @event fired when files have been selected, 
          * When a the download link is clicked
-         * @param {Roo.bootstrap.Card} this
-         * @param {Object} The image information data  contains 
+         * @param {Roo.bootstrap.UploaderButton} this
+         * @param {Array} Array of files that have been uploaded
          */
         'uploaded' : true
         
@@ -2974,12 +2979,11 @@ Roo.extend(Roo.bootstrap.ButtonUploader, Roo.bootstrap.Button,  {
         if(typeof(this.selectorEl.dom.files) == 'undefined' || !this.selectorEl.dom.files.length){
             return;
         }
+        var files = Array.prototype.slice.call(this.selectorEl.dom.files);
+        this.selectorEl.dom.reset();
+        
+        this.fireEvent('uploaded', this,  files );
         
-        Roo.each(this.selectorEl.dom.files, function(file){
-            var url = this.urlAPI.createObjectURL(file); // not sure...
-            this.fireEvent('uploaded', this, [file, url]);
-        }, this);
-         
     },
     
        
@@ -3572,6 +3576,7 @@ Roo.bootstrap.MenuMgr = function(){
  * @cfg {bool} hidden  if the menu should be hidden when rendered.
  * @cfg {bool} stopEvent (true|false)  Stop event after trigger press (default true)
  * @cfg {bool} isLink (true|false)  the menu has link disable auto expand and collaspe (default false)
+ * @cfg {bool} hideTrigger (true|false)  default false - hide the carret for trigger.
  * 
  * @constructor
  * Create a new Menu
@@ -3667,6 +3672,11 @@ Roo.extend(Roo.bootstrap.Menu, Roo.bootstrap.Component,  {
     
     isLink : false,
     
+    container_method : 'getDocumentBody', // so the menu is rendered on the body and zIndex works.
+    
+    hideTrigger : false,
+    
+    
     getChildContainer : function() {
         return this.el;  
     },
@@ -3703,12 +3713,13 @@ Roo.extend(Roo.bootstrap.Menu, Roo.bootstrap.Component,  {
         
         this.triggerEl.on(Roo.isTouch ? 'touchstart' : 'mouseup', this.onTriggerPress, this);
         
-       
-       if (this.triggerEl.hasClass('nav-item')) {
-           // dropdown toggle on the 'a' in BS4?
-           this.triggerEl.select('.nav-link',true).first().addClass('dropdown-toggle');
-       } else {
-           this.triggerEl.addClass('dropdown-toggle');
+       if (!this.hideTrigger) {
+           if (this.triggerEl.hasClass('nav-item') && this.triggerEl.select('.nav-link',true).length) {
+               // dropdown toggle on the 'a' in BS4?
+               this.triggerEl.select('.nav-link',true).first().addClass('dropdown-toggle');
+           } else {
+               this.triggerEl.addClass('dropdown-toggle');
+           }
        }
         if (Roo.isTouch) {
             this.el.on('touchstart'  , this.onTouch, this);
@@ -28955,7 +28966,7 @@ Roo.extend(Roo.bootstrap.menu.Separator, Roo.bootstrap.Component,  {
     getAutoCreate : function(){
         var cfg = {
             tag : 'li',
-            cls: 'divider'
+            cls: 'dropdown-divider divider'
         };
         
         return cfg;